|
cxxomfort
rel.20211024
Simple backports for C++ - https://ryan.gulix.cl/fossil.cgi/cxxomfort/
|
C++11 array class. More...
Public Member Functions | |
| CXXO_CONSTEXPR14 pointer | data () CXXO_NOEXCEPTNOTHROW |
| Access to the underlying array. | |
| CXXO_CONSTEXPR const_pointer | data () const CXXO_NOEXCEPTNOTHROW |
| Access to the underlying array. | |
| CXXO_CONSTEXPR size_t | size () const CXXO_NOEXCEPTNOTHROW |
| Size of the array (the same as the constant N ) | |
| CXXO_CONSTEXPR size_t | max_size () const CXXO_NOEXCEPTNOTHROW |
| Maximum size of the array (the same as size ) | |
| CXXO_CONSTEXPR bool | empty () const CXXO_NOEXCEPTNOTHROW |
Returns true if the array is empty. | |
| reference | front () CXXO_NOEXCEPTNOTHROW |
| Direct access to the first element. | |
| reference | back () CXXO_NOEXCEPTNOTHROW |
| Direct access to the last element. | |
| CXXO_CONSTEXPR14 reference | operator[] (size_t i) CXXO_NOEXCEPTNOTHROW |
| Indexed access (non-throwing) | |
| reference | at (size_t i) |
| Indexed access (throwing) | |
C++11 array class.
std::array<T,N> implementation
| N | the size of the array at compile time |
An implementation of C++03-TR1/C++11's std::array with some minor changes.
While this implementation is mostly intended for compilers that don't ship their own std::array , cxxomfort can also use it to supplement some features missing from std::array in given C++ versions, such as constexpr operator access. In this case, it's exposed also as cxxomfort::array .
Main differences from TR1's array:
operator[] (non-const) is constexpr when relaxed-constexpr support is detected..front() const and .back() const are constexpr when relaxed-constexpr.fill() is constexpr when relaxed-constexpr support is detected.
1.8.13