STIR  6.3.0
Classes | Variables
type traits for template metaprogramming that help with STIR
Collaboration diagram for type traits for template metaprogramming that help with STIR:

Classes

struct  stir::has_iterator< T, typename >
 Helper to check if a type has an iterator typedef. More...
 
struct  stir::has_full_iterator< T, typename >
 Helper to check if a type has a full_iterator typedef (e.g. Array<2,int>) More...
 
struct  stir::has_iterator_and_no_full_iterator< T >
 Helper to check if the type has an iterator but no full_iterator typedef (e.g. std::vector<int>) More...
 

Variables

template<typename T >
constexpr bool stir::has_iterator_v = has_iterator<T>::value
 Bool set to has_iterator<T>::value.
 
template<typename T >
constexpr bool stir::has_full_iterator_v = has_full_iterator<T>::value
 Bool set to has_full_iterator<T>::value.
 
template<typename T >
constexpr bool stir::has_iterator_and_no_full_iterator_v = has_iterator_and_no_full_iterator<T>::value
 Bool set to has_iterator_and_no_full_iterator<T>::value.
 

Detailed Description

Can be used as follows

// void function that is enabled only if the class has an `iterator` typedef
template <typename T>
std::enable_if_t<has_iterator_v<T>>
func(T& obj)
{
for (auto iter: obj)
// do something
}