Taskflow  3.2.0-Master-Branch
Loading...
Searching...
No Matches
tf::SmallVector< T, N > Class Template Reference

class to define a vector optimized for small array More...

#include <small_vector.hpp>

Inheritance diagram for tf::SmallVector< T, N >:
Collaboration diagram for tf::SmallVector< T, N >:

Public Member Functions

 SmallVector ()
 constructs an empty vector
 
 SmallVector (size_t Size, const T &Value=T())
 constructs a vector with Size copies of elements with value value
 
template<typename ItTy >
 SmallVector (ItTy S, ItTy E)
 constructs a vector with the contents of the range [S, E)
 
 SmallVector (std::initializer_list< T > IL)
 constructs a vector with the contents of the initializer list IL
 
 SmallVector (const SmallVector &RHS)
 constructs the vector with the copy of the contents of RHS
 
 SmallVector (SmallVector &&RHS)
 constructs the vector with the contents of RHS using move semantics
 
const SmallVectoroperator= (const SmallVector &RHS)
 replaces the contents with a copy of the contents of RHS
 
const SmallVectoroperator= (SmallVector &&RHS)
 replaces the contents with the contents of RHS using move semantics
 
 SmallVector (SmallVectorImpl< T > &&RHS)
 constructs a vector with the contents of RHS using move semantics
 
const SmallVectoroperator= (SmallVectorImpl< T > &&RHS)
 replaces the contents with the contents of RHS using move semantics
 
const SmallVectoroperator= (std::initializer_list< T > IL)
 replaces the contents with the copy of the contents of an initializer list IL
 

Detailed Description

template<typename T, unsigned N = 2>
class tf::SmallVector< T, N >

class to define a vector optimized for small array

Template Parameters
Tdata type
Nthreshold of the number of elements in the initial storage

The class defines a C++ STL-styled vector (a variable-sized array) optimized for the case when the array is small. It contains some number of elements in-place, which allows it to avoid heap allocation when the actual number of elements is below that threshold. This allows normal small cases to be fast without losing generality for large inputs. All the methods in std::vector can apply to this class.

The class is stripped from the LLVM codebase.


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