DUNE-ACFEM (unstable)
Some convenience type-traits in order to help doing SFINAE things. More...
Classes | |
struct | Dune::ACFem::MakeType< T, Other > |
struct | Dune::ACFem::IsAlwaysTrue< Predicate, SFINAE > |
Assume a predicate is a traits-class and would never evaluate to true unless it is equivalent to AlwaysTrue. More... | |
struct | Dune::ACFem::IsAlwaysTrue< Predicate, std::enable_if_t< Predicate<>::value > > |
Assume a predicate is a traits-class and would never evaluate to true unless it is equivalent to AlwaysTrue. More... | |
struct | Dune::ACFem::IsAlwaysFalse< Predicate, SFINAE > |
Assume a predicate is a traits-class and would never evaluate to false unless it is equivalent to AlwaysFalse. More... | |
struct | Dune::ACFem::IsAlwaysFalse< Predicate, std::enable_if_t<!Predicate<>::value > > |
Assume a predicate is a traits-class and would never evaluate to false unless it is equivalent to AlwaysFalse. More... | |
struct | Dune::ACFem::AndPredicate< P0, P1 > |
Logical "and" for two perdicates. More... | |
struct | Dune::ACFem::OrPredicate< P0, P1 > |
Logical "or" for two perdicates. More... | |
struct | Dune::ACFem::PredicateProxy< F, Rest > |
Wrap the given predicate class F into another one with spcial requirements. More... | |
struct | Dune::ACFem::PredicateWrapper< F > |
Wrap a predicate into a class which can be passed on as argument. More... | |
struct | Dune::ACFem::IsSequence< T, SFINAE > |
struct | Dune::ACFem::IsSequence< Sequence< T, Ints... > > |
Evaluate to TrueType of integer sequences. More... | |
struct | Dune::ACFem::IsIndexSequence< T, SFINAE > |
struct | Dune::ACFem::IsIndexSequence< IndexSequence< Ints... > > |
TrueType for integer sequences with value_type std::size_t. More... | |
struct | Dune::ACFem::IsIntegralConstant< T > |
FalseType by default. More... | |
struct | Dune::ACFem::IsIntegralConstant< Constant< T, V > > |
TrueType for integral_constant. More... | |
struct | Dune::ACFem::IsBoolConstant< T > |
struct | Dune::ACFem::IsBoolConstant< T & > |
Forward to decay traits class for non decay types. More... | |
struct | Dune::ACFem::IsBoolConstant< T && > |
Forward to decay traits class for non decay types. More... | |
struct | Dune::ACFem::IsBoolConstant< BoolConstant< V > > |
TrueType for bool constant. More... | |
struct | Dune::ACFem::IsDefined< class, SFINAE > |
struct | Dune::ACFem::IsDefined< T, std::enable_if_t<(std::is_object< T >::value &&!std::is_pointer< T >::value &&(sizeof(T) >=0))> > |
TrueType if T is an object which is not a pointer. More... | |
struct | Dune::ACFem::IsTupleLike< T, SFINAE > |
struct | Dune::ACFem::IsTupleLike< T, std::enable_if_t<(std::tuple_size< std::decay_t< T > >::value >=0)> > |
Evaluate to true if T behaves more or less like a tuple. More... | |
struct | Dune::ACFem::IsArray< T, SFINAE > |
struct | Dune::ACFem::IsArray< T, std::enable_if_t<!IsDecay< T >::value > > |
Forward to decay if T is not a decay type. More... | |
struct | Dune::ACFem::IsArray< std::array< T, N > > |
TrueType if T is a std::array. More... | |
struct | Dune::ACFem::HasResize< T, SFINAE > |
struct | Dune::ACFem::SameDecay< T1, T2 > |
TrueType if T1 and T2 have the same decay types, otherwise FalseType. More... | |
struct | Dune::ACFem::HasUnaryMinus< T, SFINAE > |
struct | Dune::ACFem::HasUnaryMinus< T, std::enable_if_t<(sizeof(decltype(-std::declval< T >())) >=0)> > |
TrueType if a T allows for the unary minus operator. More... | |
struct | Dune::ACFem::Case< C, T > |
Case-structure for multi-conditional switch. More... | |
struct | Dune::ACFem::Switch< Head, Tail > |
Recursion for a multi-conditional switch. More... | |
struct | Dune::ACFem::Switch< T > |
Recursion endpoint: If the terminating template parameter to SwitchType is not a Case template, then export T as Switch<T>::Type. More... | |
struct | Dune::ACFem::Switch< Case< C, T > > |
Recursion end-point: if the last template parameter to SwitchType is a case then export T as SwitchCase<C,T>::Type if C is true . More... | |
struct | Dune::ACFem::copy_cv_reference< T, U > |
Export a type copy_cv_reference::type which has the same qualifiers as T and decays to the decay of U. More... | |
struct | Dune::ACFem::remove_const< T > |
Export a type trough remove_const::type as follows: More... | |
struct | Dune::ACFem::IsApplicableTo< E, F > |
Is TrueType if an F can be invoked with an E. More... | |
struct | Dune::ACFem::IsIntegral< I > |
TrueType if I is an integral type. More... | |
struct | Dune::ACFem::IsScalar< F, class > |
std::true_type if F is an "elementary" scalar. More... | |
struct | Dune::ACFem::IsScalar< F, std::enable_if_t<(std::is_convertible< F *, typename FieldTraits< F >::field_type * >::value &&(std::numeric_limits< typename FieldTraits< F >::real_type >::is_iec559||std::numeric_limits< typename FieldTraits< F >::real_type >::is_integer))> > |
Standard floating point types and integral types are scalars, also FieldVectors of dimension 1 convertible to standard floating point types. More... | |
Typedefs | |
template<class T > | |
using | Dune::ACFem::IsDecay = std::is_same< T, std::decay_t< T > > |
true if T is its own decay type. | |
template<class T1 , class T2 > | |
using | Dune::ACFem::HasSameDecay = std::is_same< std::decay_t< T1 >, std::decay_t< T2 > > |
true if the decay types match. | |
template<class Base , class Derived > | |
using | Dune::ACFem::IsBaseOfDecay = std::is_base_of< std::decay_t< Base >, std::decay_t< Derived > > |
TrueType if the decay type of Base is a base of the DecayType of Derived. | |
using | Dune::ACFem::TrueType = BoolConstant< true > |
Alias for std::true_type. | |
using | Dune::ACFem::FalseType = BoolConstant< false > |
Alias for std::false_type. | |
template<class T > | |
using | Dune::ACFem::RefersConst = BoolConstant<(std::is_const< T >::value||std::is_const< std::remove_reference_t< T > >::value)> |
TrueType if const or a reference to a const. | |
template<class... T> | |
using | Dune::ACFem::FirstType = typename MakeType< T... >::Type |
Generate the first type of the template argument list. | |
template<class... Other> | |
using | Dune::ACFem::VoidType = typename MakeType< void, Other... >::Type |
Generate void regardless of the template argument list. | |
template<class... Other> | |
using | Dune::ACFem::AlwaysFalse = typename MakeType< FalseType, Other... >::Type |
Generate FalseType regardless of the template argument list. | |
template<class... Other> | |
using | Dune::ACFem::AlwaysTrue = typename MakeType< TrueType, Other... >::Type |
Generate TrueType regardless of the template argument list. | |
template<class CaseType > | |
using | Dune::ACFem::CaseNot = Case<!CaseType::value, typename CaseType::Type > |
Generate the negation of the given Case, i.e. More... | |
template<class A , class B = A> | |
using | Dune::ACFem::CaseVoid = Case< std::is_same< A, void >::value, B > |
If A is void then CaseVoid::value is true and CaseVoid::Type is B. More... | |
template<class A , class B = A> | |
using | Dune::ACFem::CaseNotVoid = CaseNot< CaseVoid< A, B > > |
If A is not void then CaseNotVoid::value is true and CaseNotVoid::Type is B. More... | |
template<class A , class B , class C = A> | |
using | Dune::ACFem::CaseSame = Case< std::is_same< A, B >::value, C > |
If A equals B export C as CaseSame::Type. More... | |
template<class A , class B , class C = A> | |
using | Dune::ACFem::CaseNotSame = CaseNot< CaseSame< A, B, C > > |
Negation of CaseSame, if A is not B then export C as CaseNotSame::Type. More... | |
template<class A , class B , class C = A> | |
using | Dune::ACFem::CaseBase = Case< std::is_base_of< A, B >::value, C > |
If A is a base of B then export C as CaseBase::Type. More... | |
template<class A , class B , class C = A> | |
using | Dune::ACFem::CaseNotBase = CaseNot< CaseBase< A, B, C > > |
Negation of CaseBase, if A is not a base of B, then export C as CaseNotBase::Type. More... | |
template<class... Cases> | |
using | Dune::ACFem::SwitchType = typename Switch< Cases... >::Type |
Multiple conditions. More... | |
template<bool C, class Yes , class No = void> | |
using | Dune::ACFem::IfElseType = SwitchType< Case< C, Yes >, No > |
Type Yes if C is true, otherwise type No which default to void. | |
template<class... A> | |
using | Dune::ACFem::OrType = SwitchType< CaseNotVoid< A >... > |
First non-void type in list. | |
template<class A , class B , class Default = void> | |
using | Dune::ACFem::AndType = SwitchType< CaseSame< A, B >, Default > |
A if A and B have same type, otherwise Default. | |
template<class From , class To > | |
using | Dune::ACFem::copy_cv_reference_t = typename copy_cv_reference< From, To >::type |
Export a type copy_cv_reference::type which has the same qualifiers as T and decays to the decay of U. More... | |
template<class T > | |
using | Dune::ACFem::remove_const_t = typename remove_const< T >::type |
Export a type trough remove_const::type as follows: More... | |
template<class T > | |
using | Dune::ACFem::RemoveRValueReferenceType = typename RemoveRValueReference< T >::Type |
If T is an rvalue reference then yield the dereferenced type. More... | |
Functions | |
constexpr auto | Dune::ACFem::trueType () |
Generate a TrueType. | |
constexpr auto | Dune::ACFem::falseType () |
Generate a FalseType. | |
template<bool Cond> | |
constexpr auto | Dune::ACFem::boolType (BoolConstant< Cond > arg=BoolConstant< Cond >{}) |
Generate a BoolConstant. | |
template<class T0 , class T1 > | |
constexpr auto | Dune::ACFem::forwardAsPair (T0 &&t0, T1 &&t1) |
Forward as pair capturing lvalue references. | |
template<class T > | |
constexpr T | Dune::ACFem::forwardReturnValue (std::remove_reference_t< T > &t) |
Forward lvalue-references as references. | |
template<class T > | |
constexpr T | Dune::ACFem::forwardReturnValue (std::remove_reference_t< T > &&t) |
Force copy for rvalue-references in order to guard against leaking references to local variables in return statements. | |
Detailed Description
Some convenience type-traits in order to help doing SFINAE things.
Typedef Documentation
◆ CaseBase
using Dune::ACFem::CaseBase = typedef Case<std::is_base_of<A, B>::value, C> |
If A is a base of B then export C as CaseBase::Type.
C defaults to A.
◆ CaseNot
using Dune::ACFem::CaseNot = typedef Case<!CaseType::value, typename CaseType::Type> |
Generate the negation of the given Case, i.e.
CaseNot::value == !CaseType::value.
◆ CaseNotBase
using Dune::ACFem::CaseNotBase = typedef CaseNot<CaseBase<A, B, C> > |
Negation of CaseBase, if A is not a base of B, then export C as CaseNotBase::Type.
C defaults to A.
◆ CaseNotSame
using Dune::ACFem::CaseNotSame = typedef CaseNot<CaseSame<A, B, C> > |
Negation of CaseSame, if A is not B then export C as CaseNotSame::Type.
C default to A.
◆ CaseNotVoid
using Dune::ACFem::CaseNotVoid = typedef CaseNot<CaseVoid<A, B> > |
If A is not void then CaseNotVoid::value is true
and CaseNotVoid::Type is B.
- Parameters
-
A The type to examine. B The type to export, defaults to A.
◆ CaseSame
using Dune::ACFem::CaseSame = typedef Case<std::is_same<A, B>::value, C> |
If A equals B export C as CaseSame::Type.
C defaults to A (not to B).
◆ CaseVoid
using Dune::ACFem::CaseVoid = typedef Case<std::is_same<A, void>::value, B> |
If A is void then CaseVoid::value is true
and CaseVoid::Type is B.
- Parameters
-
A The type to examine. B The type to export, defaults to A.
◆ copy_cv_reference_t
using Dune::ACFem::copy_cv_reference_t = typedef typename copy_cv_reference<From, To>::type |
Export a type copy_cv_reference::type which has the same qualifiers as T and decays to the decay of U.
◆ remove_const_t
using Dune::ACFem::remove_const_t = typedef typename remove_const<T>::type |
Export a type trough remove_const::type as follows:
- If T is not a reference then remove any const attribute.
- If T is an lvalue reference type then generate a mutable lvalue reference type.
◆ RemoveRValueReferenceType
using Dune::ACFem::RemoveRValueReferenceType = typedef typename RemoveRValueReference<T>::Type |
If T is an rvalue reference then yield the dereferenced type.
If T is not an rvalue-reference then simply yield T. lvalue references are kept as is.
◆ SwitchType
using Dune::ACFem::SwitchType = typedef typename Switch<Cases...>::Type |
Multiple conditions.
Last element of Cases is the default type. Cases must be of type Case<Condition, Type>, except for the last template parameter which can be used to define a default type.
SwitchType exports Cases::Type as SwitchType::Type for the first template parameter with Cases::value == true.
If no cases match, export the last template paramter as SwitchType::Type if it is not a Case. Otherwise generate a static_assert().
