Support Class Library
A set of tools providing classes and utility
require.h
Go to the documentation of this file.
1 #pragma once
2 
4 
5 namespace scl{
6  namespace concepts{
7 #ifdef SCL_CONCEPTS_REQUIRE_IS_VOID
8 
14  template <class ConceptType>
15  constexpr void require(ConceptType c){
16  static_assert(is_concept<ConceptType>(), "Cannot require a non Concept type");
17  static_assert(c, "");
18  }
19 #else
20 
27  template <class ConceptType>
28  constexpr bool require(ConceptType c){
29  static_assert(is_concept<ConceptType>(), "Cannot require a non Concept type");
30  static_assert(c, "");
31  /*
32  Concepts are designed as (usually) default constructible
33  with a defined operator bool() that asserts the different requirements
34  for the concept
35  */
36  return true;
37  }
38 #endif
39  }
40 }
Global namespace of the SCL.
Definition: alias.hpp:3
constexpr bool require(ConceptType c)
Require a concept.
Definition: require.h:28