isPermutationType::with - HaxyM/crap GitHub Wiki
crap :: isPermutationType
Defined in "crap/algorithm.d/ispermutationtype.h".
Defined in "crap/algorithm".
template <template <class, class> class Operator, class ... Types1> struct isPermutationType
{
/*...*/
template <class ... Types2> struct with;
/*...*/
};
Nested in isPermutationType (for details see isPermutationType). Checks if passed Types1... (by isPartitionType nesting type - for details see isPermutationType - Template parameters section) are (according to comparing for equality Operator passed by isPartitionType nesting type - for detials see isPermutationType - Template parameters section) premutation of other Types2....
Template parameters
Types2...- types to be checked if are forming a permutation ofTypes1...(for details see isPermutationType - Template parameters section) with equality defined byOperator(for details see isPermutationType - Template parameters section) binary comparator.
Layout
Memeber constants
value- true ifTypes1...is permutation ofTypes2...where equality is defined byOperator(seeOperatorin isPermutationType - Template parameters section) binary comparator. False if not.
Member types
value_type- type of fieldvalue. May not beboolbut should be castable to this type.
Member functions
constexpr operator value_type () const noexcept- casts whole object to itsvalue_typereturningvalue.
Usage example
#include "crap/algorithm.d/ispermutationtype.h"
template <class ... Types> class myAwsomeVariant
{
/*...*/
template <class ... OtherTypes,
std :: enable_if_t<crap :: isPermutationType <std :: is_same, Types...> :: template with<OtherTypes...>(), void*> = nullptr>
myAwsomeVariant(const myAwsomeVariant<OtherTypes...>&);
//Allow copying from other variants if their types form permutation of this one.
/*...*/
};