Support Class Library
A set of tools providing classes and utility
Boolean.h
Go to the documentation of this file.
1 #pragma once
2 
6 #include <scl/macros.h>
7 //#include <scl/concepts/require.h>
8 #include <scl/concepts/Movable.h>
15 
16 namespace scl{
17  namespace concepts{
22  template <class T>
23  struct Boolean{
24  constexpr operator bool() const{
25  using namespace scl::tools;
30  && ConvertibleTo<decltype(std::declval<T>() && true), bool>{}
31  && ConvertibleTo<decltype(std::declval<T>() || true), bool>{}
32  && ConvertibleTo<decltype(std::declval<T>() && std::declval<T>()), bool>{}
33  && ConvertibleTo<decltype(std::declval<T>() || std::declval<T>()), bool>{}
42  && Destructible<T>{}
43  >();
44  }
45  };
46  }
47 }
Conversion concept, a type From is convertible to another type To if meta::is_convertible<From, To>() is true.
Definition: ConvertibleTo.h:13
constexpr bool constexpr_assert()
InequalityComparable concept, a type T is equality comparable if it defines an operator!= with itself...
Global namespace of the SCL.
Definition: alias.hpp:3
Destructible concept, a type T is destructible if it defines a destructor that won&#39;t throw...
Definition: Destructible.h:12
Boolean concept, a type is boolean if it defines all boolean operations.
Definition: Boolean.h:23
EqualityComparableWith concept, a type T is equality comparable with another type U if it defines an ...
InequalityComparableWith concept, a type T is equality comparable with another type U if it defines a...
General purpose tooling.
Definition: iostream.hpp:4
Movable concept, a type is movable if it is both move constructible and move assignable.
Definition: Movable.h:16
EqualityComparable concept, a type T is equality comparable if it defines an operator== with itself...