FleCSI Core API Version: 2.3.2
 
Loading...
Searching...
No Matches
inplace_vector< T, SIZE > Class Template Reference

A small implementation of std::inplace_vector as proposed for C++26. More...

Public Member Functions

constexpr value_type * begin ()
 Return a pointer to the first element of the vector.
 
constexpr auto data ()
 Return a pointer to the underlaying data.
 
constexpr bool empty () const
 Check if the vector is empty.
 
constexpr value_type * end ()
 Return a pointer past the last element of the vector.
 
constexpr const value_type & operator[] (int i) const
 Return the element i of the vector.
 
constexpr void push_back (const value_type &v)
 Add an element at the end of a vector.
 
constexpr std::size_t size () const
 Return the size of the used portion of the vector.
 

Detailed Description

template<typename T, std::size_t SIZE>
class flecsi::util::inplace_vector< T, SIZE >

A small implementation of std::inplace_vector as proposed for C++26.

This class is supported for GPU execution.

Member Function Documentation

◆ push_back()

template<typename T , std::size_t SIZE>
void push_back ( const value_type & v)
constexpr

Add an element at the end of a vector.

Parameters
vElement to be inserted

◆ operator[]()

template<typename T , std::size_t SIZE>
const value_type & operator[] ( int i) const
constexpr

Return the element i of the vector.

Parameters
iThe position of the element to return

◆ data()

template<typename T , std::size_t SIZE>
auto data ( )
constexpr

Return a pointer to the underlaying data.

◆ size()

template<typename T , std::size_t SIZE>
std::size_t size ( ) const
constexpr

Return the size of the used portion of the vector.

◆ empty()

template<typename T , std::size_t SIZE>
bool empty ( ) const
constexpr

Check if the vector is empty.

◆ begin()

template<typename T , std::size_t SIZE>
value_type * begin ( )
constexpr

Return a pointer to the first element of the vector.

◆ end()

template<typename T , std::size_t SIZE>
value_type * end ( )
constexpr

Return a pointer past the last element of the vector.