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


Layout

Memeber constants

Member types

  • value_type - type of field value. May not be bool but should be castable to this type.

Member functions

  • constexpr operator value_type () const noexcept - casts whole object to its value_type returning value.

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.
 /*...*/
};

See also