Generator container that returns the same element for every access.
More...
|
| single_container (T const &x, size_t size=std::numeric_limits< size_t >::max()) |
| Create the container by initializing the single element and providing a size. More...
|
|
value_type | get_element (size_t const &i) const |
| Retrieve a copy of the element at a specific index. In actuality, returns the same element for every invocation. More...
|
|
value_type | operator[] (size_t const &i) const |
| Retrieve a copy of the element at a specific index. In actuality, returns the same element for every invocation. More...
|
|
size_t | size () const |
| Return the size of this container.
|
|
domain_type | domain () const |
| Create a linear domain of the GIDs in this container.
|
|
|
typedef T | value_type |
|
typedef value_type | mapped_type |
|
typedef value_type | reference |
|
typedef indexed_domain< size_t > | domain_type |
|
typedef size_t | gid_type |
|
template<typename T>
struct stapl::single_container< T >
Generator container that returns the same element for every access.
If there is a single_container c, there exists some element x such that c[i] == x for all i.
- Template Parameters
-
T | Type of the stored element in the container. |
◆ single_container()
Create the container by initializing the single element and providing a size.
- Parameters
-
x | The element that is to be stored in this container. |
size | Size of this container |
◆ get_element()
Retrieve a copy of the element at a specific index. In actuality, returns the same element for every invocation.
- Parameters
-
i | The index of the element to retrieve (unused) |
- Returns
- Copy of the stored element.
◆ operator[]()
Retrieve a copy of the element at a specific index. In actuality, returns the same element for every invocation.
- Parameters
-
i | The index of the element to retrieve (unused) |
- Returns
- Copy of the stored element.
The documentation for this struct was generated from the following file: