-
Notifications
You must be signed in to change notification settings - Fork 2
noneOfType
Igor Zarzycki edited this page Jan 23, 2022
·
3 revisions
Defined in "crap/algorithm.d/noneoftype.h".
Defined in "crap/algorithm".
template <template <class> class Operator, class ... Types> struct noneOfType;
Returns if none of Types...
satisfies Operator
acting on each of them.
-
Operator
- functor transforming each ofTypes...
element into logical (or logicaly interpretable) value. Must give its answer in field namedvalue
. -
Types...
- set of types to operate on. If this set is empty whole operation is evaluated to true. If set is single element then whole operation is evaluated to negation of result ofOperator
acting on that element.
value
- holds result of operation. If Types...
is empty it will be evaluated as true
.
value_type
- type of field value
. May not be bool
but should be castable to this type.
constexpr operator value_type () const noexcept
- casts whole object to its value_type
returning value
.
#include <crap/algorithm.d/noneoftype.h>
#include <type_traits>
template <class ... FieldTypes> class MyAwsomeTuple
{
public:
static_assert(crap :: noneOfType<std :: is_void, FieldTypes...>{}, "Non of fields may be void.");
/*Some more code.*/
};