|
__cuda_callable__ constexpr | StaticArray ()=default |
| Default constructor.
|
|
__cuda_callable__ constexpr | StaticArray (const StaticArray &v) |
| Copy constructor.
|
|
template<typename OtherValue > |
__cuda_callable__ constexpr | StaticArray (const StaticArray< Size, OtherValue > &v) |
| Templated copy constructor.
|
|
template<typename OtherValue > |
constexpr | StaticArray (const StaticArray< Size, OtherValue > &v) |
|
template<typename OtherValue > |
__cuda_callable__ constexpr | StaticArray (const std::array< OtherValue, Size > &array) |
| Constructor which initializes the array by copying elements from std::array.
|
|
template<typename OtherValue > |
__cuda_callable__ constexpr | StaticArray (const std::initializer_list< OtherValue > &elems) |
| Constructor which initializes the array by copying elements from std::initializer_list, e.g. {...} .
|
|
__cuda_callable__ constexpr | StaticArray (const Value &v) |
| Constructor that sets all array components to value v.
|
|
template<typename _unused = void> |
__cuda_callable__ constexpr | StaticArray (const Value v[Size]) |
| Constructor from static array.
|
|
template<typename _unused > |
constexpr | StaticArray (const Value v[Size]) |
|
constexpr | StaticArray (StaticArray &&) noexcept=default |
| Move constructor.
|
|
__cuda_callable__ constexpr | StaticArray (std::array< Value, Size > &&array) |
| Constructor which initializes the array by moving elements from std::array.
|
|
template<typename... Values, std::enable_if_t<(Size > 1) &&sizeof...(Values)==Size, bool > = true> |
__cuda_callable__ constexpr | StaticArray (Values &&... values) |
| Constructor which initializes the array element-by-element using the supplied values.
|
|
constexpr const Value * | getData () const noexcept |
| Gets constant pointer to data of this static array.
|
|
constexpr Value * | getData () noexcept |
| Gets pointer to data of this static array.
|
|
constexpr Value | getElement (IndexType i) const noexcept |
| Returns the value of the i-th element.
|
|
void | load (File &file) |
| Loads data from the file to this static array.
|
|
template<typename Array > |
constexpr bool | operator!= (const Array &array) const |
| This function checks whether this static array is not equal to another array.
|
|
constexpr const Value & | operator() (int i) const noexcept |
| Accesses specified element at the position i and returns a constant reference to its value.
|
|
constexpr Value & | operator() (int i) noexcept |
| Accesses specified element at the position i and returns a reference to its value.
|
|
constexpr StaticArray & | operator= (const StaticArray &v) |
| Copy-assignment operator.
|
|
template<typename T > |
constexpr StaticArray< Size, Value > & | operator= (const T &v) |
| Assigns an object v of type T.
|
|
constexpr StaticArray & | operator= (StaticArray &&) noexcept=default |
| Move-assignment operator.
|
|
template<typename Array > |
constexpr bool | operator== (const Array &array) const |
| This function checks whether this static array is equal to another array.
|
|
constexpr const Value & | operator[] (int i) const noexcept |
| Accesses specified element at the position i and returns a constant reference to its value.
|
|
constexpr Value & | operator[] (int i) noexcept |
| Accesses specified element at the position i and returns a reference to its value.
|
|
void | save (File &file) const |
| Saves this static array into the file.
|
|
constexpr void | setElement (IndexType i, ValueType value) noexcept |
| Sets the value of the i-th element to value.
|
|
constexpr void | setValue (const ValueType &val) |
| Sets all values of this static array to val.
|
|
constexpr void | sort () |
| Sorts the elements in this static array in ascending order.
|
|
std::ostream & | write (std::ostream &str, const char *separator=" ") const |
| Writes the array values into stream str with specified separator.
|
|
constexpr const Value & | x () const noexcept |
| Returns constant reference to the first coordinate.
|
|
constexpr Value & | x () noexcept |
| Returns reference to the first coordinate.
|
|
constexpr const Value & | y () const noexcept |
| Returns constant reference to the second coordinate for arrays with Size >= 2.
|
|
constexpr Value & | y () noexcept |
| Returns reference to the second coordinate for arrays with Size >= 2.
|
|
constexpr const Value & | z () const noexcept |
| Returns constant reference to the third coordinate for arrays with Size >= 3.
|
|
constexpr Value & | z () noexcept |
| Returns reference to the third coordinate for arrays with Size >= 3.
|
|
template<int Size, typename Value>
class TNL::Containers::StaticArray< Size, Value >
Array with constant size.
- Template Parameters
-
Size | Size of static array. Number of its elements. |
Value | Type of the values in static array. |