vSMC
vSMC: Scalable Monte Carlo
|
Static array. More...
#include <vsmc/utility/array.hpp>
Public Types | |
typedef const_pointer | const_iterator |
typedef const value_type * | const_pointer |
typedef const value_type & | const_reference |
typedef std::reverse_iterator< const_iterator > | const_reverse_iterator |
typedef std::ptrdiff_t | difference_type |
typedef pointer | iterator |
typedef value_type * | pointer |
typedef value_type & | reference |
typedef std::reverse_iterator< iterator > | reverse_iterator |
typedef std::size_t | size_type |
typedef T | value_type |
Public Member Functions | |
reference | at (size_type pos) |
const_reference | at (size_type pos) const |
template<size_type Pos> | |
reference | at () |
template<size_type Pos> | |
const_reference | at () const |
template<size_type Pos> | |
reference | at (Position< Pos >) |
template<size_type Pos> | |
const_reference | at (Position< Pos >) const |
reference | back () |
const_reference | back () const |
iterator | begin () |
const_iterator | begin () const |
const_iterator | cbegin () const |
const_iterator | cend () const |
const_reverse_iterator | crbegin () const |
const_reverse_iterator | crend () const |
pointer | data () |
const_pointer | data () const |
iterator | end () |
const_iterator | end () const |
void | fill (const T &value) |
reference | front () |
const_reference | front () const |
reference | operator[] (size_type pos) |
const_reference | operator[] (size_type pos) const |
template<size_type Pos> | |
reference | operator[] (Position< Pos >) |
template<size_type Pos> | |
const_reference | operator[] (Position< Pos >) const |
reverse_iterator | rbegin () |
const_reverse_iterator | rbegin () const |
reverse_iterator | rend () |
const_reverse_iterator | rend () const |
template<typename Archive > | |
void | serialize (Archive &ar, const unsigned) |
template<typename Archive > | |
void | serialize (Archive &ar, const unsigned) const |
void | swap (Array< T, N > &other) |
Static Public Member Functions | |
static constexpr bool | empty () |
static constexpr size_type | max_size () |
static constexpr size_type | size () |
Friends | |
bool | operator!= (const Array< T, N > &ary1, const Array< T, N > &ary2) |
bool | operator< (const Array< T, N > &ary1, const Array< T, N > &ary2) |
template<typename CharT , typename Traits > | |
std::basic_ostream< CharT, Traits > & | operator<< (std::basic_ostream< CharT, Traits > &os, const Array< T, N > &ary) |
bool | operator<= (const Array< T, N > &ary1, const Array< T, N > &ary2) |
bool | operator== (const Array< T, N > &ary1, const Array< T, N > &ary2) |
bool | operator> (const Array< T, N > &ary1, const Array< T, N > &ary2) |
bool | operator>= (const Array< T, N > &ary1, const Array< T, N > &ary2) |
template<typename CharT , typename Traits > | |
std::basic_istream< CharT, Traits > & | operator>> (std::basic_istream< CharT, Traits > &is, Array< T, N > &ary) |
Static array.
The Array
container is almost identical to std::array
with a few minor differences.
size()
, max_size()
and empty()
member functions are static
and can be used as constant expression if C++11 constexpr
is supportedat<Pos>()
, at(Position<Pos>)
and operator[](Position<Pos>)
member functions, which perform static assertions of the index instead of runtime assertion. They can also be used to write loop unrolling functions for the container. They are preferred way to access elements since they provide bounds checking without performance penalty.get
and swap
are defined in the namespace vsmc
. Use the swap idiom, instead of calling std::swap(obj1, obj2)
. See "Effective C++". The library does not pollute the std
namespace in any way.std::tuple_size
and std::tuple_element
are not defined for Array. Same reason as above. Instead, use vsmc::TupleSize
and vsmc::TupleElement
.It also provides a few other member functions not presented in std::array
, see the documents.
typedef const_pointer vsmc::Array< T, N >::const_iterator |
typedef const value_type* vsmc::Array< T, N >::const_pointer |
typedef const value_type& vsmc::Array< T, N >::const_reference |
typedef std::reverse_iterator<const_iterator> vsmc::Array< T, N >::const_reverse_iterator |
typedef std::ptrdiff_t vsmc::Array< T, N >::difference_type |
typedef pointer vsmc::Array< T, N >::iterator |
typedef value_type* vsmc::Array< T, N >::pointer |
typedef value_type& vsmc::Array< T, N >::reference |
typedef std::reverse_iterator<iterator> vsmc::Array< T, N >::reverse_iterator |
typedef std::size_t vsmc::Array< T, N >::size_type |
typedef T vsmc::Array< T, N >::value_type |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inlinestatic |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inlinestatic |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inlinestatic |
|
inline |