|
5.0.0
Freundlich's C++ toolkit
|
An n-dimensional array.
See fcppt.container.grid for more information.
Public Types | |
| using | static_size = std::integral_constant<fcppt::container::grid::size_type, N> |
| using | allocator_type = A |
| using | value_type = T |
| using | size_type = typename container::size_type |
| using | difference_type = typename container::difference_type |
| using | reference = typename container::reference |
| using | const_reference = typename container::const_reference |
| using | iterator = typename container::iterator |
| using | const_iterator = typename container::const_iterator |
| using | dim = fcppt::container::grid::dim<size_type, N> |
| A type representing the dimension of the grid. | |
| using | pos = fcppt::container::grid::pos<size_type, N> |
| A type representing a position in the grid. | |
| using | signed_pos = fcppt::container::grid::pos<difference_type, N> |
| A signed version of pos. | |
Public Member Functions | |
| object () | |
| An empty grid. | |
| object (dim const &d, value_type const &r) | |
| Initialize the grid to a size and fill every cell with the same value. | |
| template<typename Function> | |
| object (dim const &size, Function const &function) | |
| Initialize the grid by calling a function for every element. | |
| template<typename Arg1, typename... Args> requires (std::conjunction_v< fcppt::container::grid::is_static_row<Arg1>, fcppt::container::grid::is_static_row<Args>...>) | |
| object (Arg1 &&, Args &&...) | |
| Initialize the grid from a sequence of fcppt::container::grid::static_row_type. | |
| object (object const &) | |
| object (object &&) noexcept(std::is_nothrow_move_constructible_v< T >) | |
| object & | operator= (object const &) |
| object & | operator= (object &&) noexcept(std::is_nothrow_move_assignable_v< T >) |
| ~object () | |
| reference | get_unsafe (pos const &) |
| Returns a reference to the grid element at a specified position. | |
| const_reference | get_unsafe (pos const &) const |
| Returns a reference to the grid element at a specified position. | |
| dim const & | size () const |
| Returns the grid's size. | |
| size_type | content () const |
| Returns the number of elements in the grid. | |
| bool | empty () const |
| Tests if the grid is empty. | |
| iterator | begin () |
| iterator | end () |
| const_iterator | begin () const |
| const_iterator | end () const |
| void | swap (object &) noexcept |
| Exchanges the elements of two grids. | |
| using fcppt::container::grid::object< T, N, A >::allocator_type = A |
| using fcppt::container::grid::object< T, N, A >::const_iterator = typename container::const_iterator |
| using fcppt::container::grid::object< T, N, A >::const_reference = typename container::const_reference |
| using fcppt::container::grid::object< T, N, A >::difference_type = typename container::difference_type |
| using fcppt::container::grid::object< T, N, A >::dim = fcppt::container::grid::dim<size_type, N> |
A type representing the dimension of the grid.
| using fcppt::container::grid::object< T, N, A >::iterator = typename container::iterator |
| using fcppt::container::grid::object< T, N, A >::pos = fcppt::container::grid::pos<size_type, N> |
A type representing a position in the grid.
| using fcppt::container::grid::object< T, N, A >::reference = typename container::reference |
| using fcppt::container::grid::object< T, N, A >::signed_pos = fcppt::container::grid::pos<difference_type, N> |
A signed version of pos.
| using fcppt::container::grid::object< T, N, A >::size_type = typename container::size_type |
| using fcppt::container::grid::object< T, N, A >::static_size = std::integral_constant<fcppt::container::grid::size_type, N> |
| using fcppt::container::grid::object< T, N, A >::value_type = T |
| fcppt::container::grid::object< T, N, A >::object | ( | ) |
An empty grid.
| fcppt::container::grid::object< T, N, A >::object | ( | dim const & | d, |
| value_type const & | r ) |
Initialize the grid to a size and fill every cell with the same value.
| d | The size of the grid |
| r | The value to assign to each element of the grid |
| fcppt::container::grid::object< T, N, A >::object | ( | dim const & | size, |
| Function const & | function ) |
Initialize the grid by calling a function for every element.
Calls function for every position in the grid.
| Function | A function of type value_type (pos) |
|
explicit |
Initialize the grid from a sequence of fcppt::container::grid::static_row_type.
Use fcppt::container::grid::static_row to create a grid row. For example, calling this constructro with static_row(1,2,3),static_row(4,5,6) will yields a grid of size 3x2.
All arguments must have the same size (i.e. row length) and all rows must have value type T.
| fcppt::container::grid::object< T, N, A >::object | ( | object< T, N, A > const & | ) |
|
noexcept |
| fcppt::container::grid::object< T, N, A >::~object | ( | ) |
|
nodiscard |
|
nodiscard |
|
nodiscard |
Returns the number of elements in the grid.
|
nodiscard |
Tests if the grid is empty.
|
nodiscard |
|
nodiscard |
|
nodiscard |
Returns a reference to the grid element at a specified position.
|
nodiscard |
Returns a reference to the grid element at a specified position.
|
noexcept |
| object & fcppt::container::grid::object< T, N, A >::operator= | ( | object< T, N, A > const & | ) |
|
nodiscard |
|
noexcept |
Exchanges the elements of two grids.