Manifold 3.0
Robust geometry
 
Loading...
Searching...
No Matches
VecView< T > Class Template Reference

#include <vec_view.h>

Public Types

using Iter = T *
 
using IterC = const T *
 

Public Member Functions

 VecView (T *ptr, size_t size)
 
 VecView (const std::vector< std::remove_cv_t< T > > &v)
 
 VecView (const VecView &other)
 
VecViewoperator= (const VecView &other)
 
 operator VecView< const T > () const
 
const T & operator[] (size_t i) const
 
T & operator[] (size_t i)
 
IterC cbegin () const
 
IterC cend () const
 
IterC begin () const
 
IterC end () const
 
Iter begin ()
 
Iter end ()
 
const T & front () const
 
const T & back () const
 
T & front ()
 
T & back ()
 
size_t size () const
 
bool empty () const
 
VecView< T > view (size_t offset=0, size_t length=std::numeric_limits< size_t >::max())
 
VecView< const T > cview (size_t offset=0, size_t length=std::numeric_limits< size_t >::max()) const
 
VecView< const T > view (size_t offset=0, size_t length=std::numeric_limits< size_t >::max()) const
 
T * data ()
 
const T * data () const
 
void Dump () const
 

Protected Attributes

T * ptr_ = nullptr
 
size_t size_ = 0
 

Detailed Description

template<typename T>
class manifold::VecView< T >

View for Vec, can perform offset operation. This will be invalidated when the original vector is dropped or changes length. Roughly equivalent to std::span<T> from c++20