tvm
Classes | Public Types | Public Member Functions | Protected Attributes | List of all members
tvm::support::Span< T, W > Class Template Reference

A partial implementation of the C++20 std::span. More...

#include <span.h>

Collaboration diagram for tvm::support::Span< T, W >:

Classes

class  iterator_base
 

Public Types

using value_type = W
 
using const_W = typename std::add_const< W >::type
 
using iterator = iterator_base< W >
 
using const_iterator = iterator_base< const_W >
 

Public Member Functions

 Span (T *begin, int num_elements)
 
 Span (T *begin, T *end)
 
iterator begin () const
 
iterator end () const
 
size_t size () const
 
operator[] (int i)
 

Protected Attributes

T * begin_
 
T * end_
 

Detailed Description

template<class T, class W>
class tvm::support::Span< T, W >

A partial implementation of the C++20 std::span.

At the time of writing, TVM must compile against C++17.

Member Typedef Documentation

◆ const_iterator

template<class T , class W >
using tvm::support::Span< T, W >::const_iterator = iterator_base<const_W>

◆ const_W

template<class T , class W >
using tvm::support::Span< T, W >::const_W = typename std::add_const<W>::type

◆ iterator

template<class T , class W >
using tvm::support::Span< T, W >::iterator = iterator_base<W>

◆ value_type

template<class T , class W >
using tvm::support::Span< T, W >::value_type = W

Constructor & Destructor Documentation

◆ Span() [1/2]

template<class T , class W >
tvm::support::Span< T, W >::Span ( T *  begin,
int  num_elements 
)
inline

◆ Span() [2/2]

template<class T , class W >
tvm::support::Span< T, W >::Span ( T *  begin,
T *  end 
)
inline

Member Function Documentation

◆ begin()

template<class T , class W >
iterator tvm::support::Span< T, W >::begin ( ) const
inline

◆ end()

template<class T , class W >
iterator tvm::support::Span< T, W >::end ( ) const
inline

◆ operator[]()

template<class T , class W >
W tvm::support::Span< T, W >::operator[] ( int  i)
inline

◆ size()

template<class T , class W >
size_t tvm::support::Span< T, W >::size ( ) const
inline

Member Data Documentation

◆ begin_

template<class T , class W >
T* tvm::support::Span< T, W >::begin_
protected

◆ end_

template<class T , class W >
T* tvm::support::Span< T, W >::end_
protected

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