CASM  1.1.0
A Clusters Approach to Statistical Mechanics
CASM::CASM_TMP Namespace Reference

Classes

struct  IfIntegralTol
 
struct  IfIntegralTol< tol_type, true >
 
struct  IfIntegralTol< tol_type, false >
 
struct  IntegralLessThan
 
struct  FloatingPointLessThan
 
struct  make_void
 Alias for void, to help SFINAE work. More...
 
struct  is_iterator
 Base type inherits from std::false_type if T is not iterator. More...
 
struct  is_iterator< T, void_t< decltype(++std::declval< T & >()), decltype(*std::declval< T & >()), decltype(std::declval< T & >()==std::declval< T & >())> >
 Specialized case inherits from std::true_type if T is an iterator. More...
 
struct  UnaryIdentity
 Unary transformation that behaves as Identity (i.e. transform(arg) == arg is true) More...
 
struct  ConstantFunctor
 N-nary function that behaves as a constant (i.e. transform(arg1,arg2,...) == constant is true) More...
 
struct  BracketAccess
 Helper Functor for Counter container access using operator[]. More...
 
struct  ParenthesesAccess
 Helper Functor for Counter container access using operator() More...
 
struct  for_each_type_impl
 
struct  for_each_type_impl< 1 >
 
struct  for_type_impl
 
struct  for_type_impl< 1 >
 
struct  for_type_short_impl
 
struct  for_type_short_impl< 1 >
 
struct  for_each_element_impl
 
struct  for_each_element_impl< I, true >
 
struct  has_type
 
struct  has_type< T, std::tuple<> >
 
struct  has_type< T, std::tuple< U, Ts... > >
 
struct  has_type< T, std::tuple< T, Ts... > >
 

Typedefs

template<typename T >
using TypedTol = IfIntegralTol< T, std::is_integral< T >::value >
 
template<typename T >
using MuchLessThan = typename std::conditional< std::is_integral< T >::value, IntegralLessThan< T >, FloatingPointLessThan< T > >::type
 
template<typename... Ts>
using void_t = typename make_void< Ts... >::type
 Alias for void, to help SFINAE work. More...
 
template<typename T >
using enable_if_iterator = std::enable_if< is_iterator< T >::type::value, void >
 Template alias to enable a template function via SFINAE for any iterator. More...
 
template<typename T , typename V >
using enable_if_iterator_of = std::enable_if< is_iterator< T >::type::value &&std::is_same< typename std::iterator_traits< T >::value_type, V >::type::value, void >
 Template alias to enable a template function via SFINAE for an iterator with value_type V. More...
 
template<bool IsConst, typename T >
using ConstSwitch = typename std::conditional< IsConst, const T, T >::type
 
template<typename MostDerived >
using CRTPBase = notstd::CRTPBase< MostDerived >
 

Functions

template<typename... Args>
void ignore_returnvalues (Args &&...)
 Enables calling a function on each argument in a parameter pack. More...
 
template<typename TupleType , typename F >
void for_each_type (F f=F())
 
template<typename TupleType , typename F >
void for_type (std::string name, F f=F())
 
template<typename TupleType , typename F >
void for_type_short (std::string short_name, F f=F())
 
template<typename TupleType , typename F >
void for_each_element (F f=F())
 Call f.eval<I>(), for int I in range [0, std::tuple_size<TupleType>::value) More...
 

Typedef Documentation

◆ ConstSwitch

template<bool IsConst, typename T >
using CASM::CASM_TMP::ConstSwitch = typedef typename std::conditional<IsConst, const T, T>::type

Definition at line 78 of file CASM_TMP.hh.

◆ CRTPBase

template<typename MostDerived >
using CASM::CASM_TMP::CRTPBase = typedef notstd::CRTPBase<MostDerived>

Definition at line 28 of file CRTPBase.hh.

◆ enable_if_iterator

template<typename T >
using CASM::CASM_TMP::enable_if_iterator = typedef std::enable_if<is_iterator<T>::type::value, void>

Template alias to enable a template function via SFINAE for any iterator.

  • example function argument: 'typename CASM_TMP::enable_if_iterator<IteratorType>::type* = nullptr'

Definition at line 63 of file CASM_TMP.hh.

◆ enable_if_iterator_of

template<typename T , typename V >
using CASM::CASM_TMP::enable_if_iterator_of = typedef std::enable_if< is_iterator<T>::type::value && std::is_same<typename std::iterator_traits<T>::value_type, V>::type::value, void>

Template alias to enable a template function via SFINAE for an iterator with value_type V.

  • example function argument: 'typename CASM_TMP::enable_if_iterator_of<IteratorType, ValueType>::type* = nullptr'

Definition at line 71 of file CASM_TMP.hh.

◆ MuchLessThan

template<typename T >
using CASM::CASM_TMP::MuchLessThan = typedef typename std::conditional<std::is_integral<T>::value, IntegralLessThan<T>, FloatingPointLessThan<T> >::type

Definition at line 72 of file CASM_math.hh.

◆ TypedTol

template<typename T >
using CASM::CASM_TMP::TypedTol = typedef IfIntegralTol<T, std::is_integral<T>::value>

Definition at line 47 of file CASM_math.hh.

◆ void_t

template<typename... Ts>
using CASM::CASM_TMP::void_t = typedef typename make_void<Ts...>::type

Alias for void, to help SFINAE work.

Definition at line 38 of file CASM_TMP.hh.

Function Documentation

◆ for_each_element()

template<typename TupleType , typename F >
void CASM::CASM_TMP::for_each_element ( f = F())

Call f.eval<I>(), for int I in range [0, std::tuple_size<TupleType>::value)

Definition at line 328 of file CASM_TMP.hh.

◆ for_each_type()

template<typename TupleType , typename F >
void CASM::CASM_TMP::for_each_type ( f = F())

Definition at line 238 of file CASM_TMP.hh.

◆ for_type()

template<typename TupleType , typename F >
void CASM::CASM_TMP::for_type ( std::string  name,
f = F() 
)

Definition at line 269 of file CASM_TMP.hh.

◆ for_type_short()

template<typename TupleType , typename F >
void CASM::CASM_TMP::for_type_short ( std::string  short_name,
f = F() 
)

Definition at line 300 of file CASM_TMP.hh.

◆ ignore_returnvalues()

template<typename... Args>
void CASM::CASM_TMP::ignore_returnvalues ( Args &&  ...)

Enables calling a function on each argument in a parameter pack.

Definition at line 26 of file CASM_TMP.hh.