MeshLib C++ Docs
Loading...
Searching...
No Matches
MR::Buffer< V, I > Class Template Reference

std::vector<V>-like container that is 1) resized without initialization of its elements, 2) much simplified: no push_back and many other methods More...

#include <MRBuffer.h>

Public Types

using T = typename NoCtor<V>::type
 
using reference = T&
 
using const_reference = const T&
 
using iterator = T*
 
using const_iterator = const T*
 

Public Member Functions

 Buffer ()=default
 
 Buffer (size_t size)
 
auto capacity () const
 
auto size () const
 
bool empty () const
 
void clear ()
 
void resize (size_t newSize)
 
const_reference operator[] (I i) const MR_LIFETIMEBOUND
 
reference operator[] (I i) MR_LIFETIMEBOUND
 
auto data () MR_LIFETIMEBOUND
 
auto data () const MR_LIFETIMEBOUND
 
beginId () const
 returns the identifier of the first element
 
backId () const
 returns the identifier of the back() element
 
endId () const
 returns backId() + 1
 
size_t heapBytes () const
 returns the amount of memory this object occupies on heap
 

Detailed Description

template<typename V, typename I>
class MR::Buffer< V, I >

std::vector<V>-like container that is 1) resized without initialization of its elements, 2) much simplified: no push_back and many other methods

Template Parameters
Vtype of stored elements
Itype of index (shall be convertible to size_t)

The documentation for this class was generated from the following file: