Class describing a runtime defined subscript.
More...
#include <rexlib/core/layout/dynamic_subscript.hpp>
|
| enum class | subscript_type { ellipsis
, new_axis
, index
, slice
} |
| | Enumeration holding the types this object can hold.
|
| |
Class describing a runtime defined subscript.
A subscript may be either a
◆ dynamic_subscript() [1/2]
| REXLIB_NO_EXPLICIT REXLIB_CONSTEXPR rexlib::dynamic_subscript::dynamic_subscript |
( |
std::ptrdiff_t |
index | ) |
|
|
noexcept |
Construct a dynamic_subscript holding an index.
- Parameters
-
| index | The index that is assigned to this object. |
◆ dynamic_subscript() [2/2]
| REXLIB_NO_EXPLICIT REXLIB_CONSTEXPR rexlib::dynamic_subscript::dynamic_subscript |
( |
const slice & |
slice | ) |
|
|
noexcept |
Construct a dynamic_subscript holding a slice.
- Parameters
-
| slice | the slice that is assigned to this object. |
◆ get_index()
| std::ptrdiff_t rexlib::dynamic_subscript::get_index |
( |
| ) |
const |
Get the index.
This method shall only be called if get_subscript_type() returns subscript_type::index. Otherwise an exception is thrown.
- Returns
- std::ptrdiff_t The index held by this object.
- Exceptions
-
◆ get_slice()
| slice rexlib::dynamic_subscript::get_slice |
( |
| ) |
const |
Get the slice.
This method shall only be called if get_subscript_type() returns subscript_type::slice. Otherwise an exception is thrown.
- Returns
- slice The slice held by this object.
- Exceptions
-
◆ get_subscript_type()
| REXLIB_CONSTEXPR subscript_type rexlib::dynamic_subscript::get_subscript_type |
( |
| ) |
const |
|
noexcept |
Get the subscript type held by this object.
- Returns
- subscript_type
The documentation for this class was generated from the following file: