-
Notifications
You must be signed in to change notification settings - Fork 2
allOfType
Igor Zarzycki edited this page Jan 22, 2022
·
11 revisions
Defined in "crap/algorithm.d/alloftype.h".
Defined in "crap/algorithm".
template <template <class> class Operator, class ... Types> struct allOfType;
Forms logical conjunction of result of Operator
acting on each of Types
.
-
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 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/allOfType.h>
#include <type_traits>
template <class ... FieldTypes> class MyAwsomeTuple
{
public:
MyAwsomeTuple() //Default constructor is noexcept if none of field may throw while being defaultly constructed.
noexcept(crap :: allOfType<std :: is_nothrow_default_constructible, FieldTypes...>{});
/*Some more code.*/
};