allOfType - HaxyM/crap GitHub Wiki

crap :: allOfType

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.

Template parameters

  • Operator - functor transforming each of Types... element into logical (or logicaly interpretable) value. Must give its answer in field named value.
  • 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 of Operator acting on that element.

Layout

Member constants

value - holds result of operation. If Types... is empty it will be evaluated as true.

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

See also

⚠️ **GitHub.com Fallback** ⚠️