Support Class Library
A set of tools providing classes and utility
Namespaces | Classes | Functions
scl::concepts Namespace Reference

A lightweight concept-like library for C++11. More...

Namespaces

 details
 Implementation details for concepts.
 

Classes

struct  AssignableWith
 AssignableWith concept, a type U is assignable to a type T if operator=() is defined for both types (or implicit conversions) More...
 
struct  BinaryPredicate
 BinaryPredicate concept, a type F is a binary predicate over T and U if it is an n-ary predicate over those types. More...
 
struct  Boolean
 Boolean concept, a type is boolean if it defines all boolean operations. More...
 
struct  CharTraits
 CharTraits concept. More...
 
struct  Constructible
 Constructible concept, a type is constructible with the given arguments if it is destructible and meta::is_constructible<T, Args...>() is true. More...
 
struct  ConvertibleTo
 Conversion concept, a type From is convertible to another type To if meta::is_convertible<From, To>() is true. More...
 
struct  Copyable
 Copyable concept, a type is copyable if it is both copy constructible and copy assignable. More...
 
struct  CopyAssignable
 CopyAssignable concept, a type T is copy assignable if meta::is_copy_assignable<T>() is true. More...
 
struct  CopyConstructible
 CopyConstructible concept, a type T is copy constructible if meta::is_copy_constructible<T>() is true. More...
 
struct  DefaultConstructible
 DefaultConstructible concept, a type T is default constructible if it defines a default constructor. More...
 
struct  DerivedFrom
 DerivedFrom concept, a type Derived is derived from another type Base if Derived is a derives from Base. More...
 
struct  Destructible
 Destructible concept, a type T is destructible if it defines a destructor that won't throw. More...
 
struct  EqualityComparable
 EqualityComparable concept, a type T is equality comparable if it defines an operator== with itself. More...
 
struct  EqualityComparableWith
 EqualityComparableWith concept, a type T is equality comparable with another type U if it defines an operator== with U. More...
 
struct  FunctionObject
 FunctionObject concept, a type F is a function object that accepts Args... More...
 
struct  Hash
 Hash concept, a type T is an hash for Key if it is a function object, copy constructible, destructible, and the return type of its invocation w/ a Key is std::size_t. More...
 
struct  InequalityComparable
 InequalityComparable concept, a type T is equality comparable if it defines an operator!= with itself. More...
 
struct  InequalityComparableWith
 InequalityComparableWith concept, a type T is equality comparable with another type U if it defines an operator!= with U. More...
 
struct  Integral
 Intergal concept, a type T is integral if meta:is_integral<T>() is true. More...
 
struct  Invocable
 Invocable concept, a type F is invocable with Args if meta::is_invocable<F, Args...>() is true. More...
 
struct  Iterator
 Iterator concept, a type is an iterator if it is copyable, destructible, swappable, has well-defined iterator_traits and can be incremented and dereferenced. More...
 
struct  LessThanComparable
 LessThanComparable concept, a type T is less than comparable if it defines an operator< with itself. More...
 
struct  LessThanComparableWith
 LessThanComparableWith concept, a type T is equality comparable with another type U if it defines an operator< with U. More...
 
struct  Movable
 Movable concept, a type is movable if it is both move constructible and move assignable. More...
 
struct  MoveAssignable
 MoveAssignable concept, a type T is move assignable if meta::is_move_assignable<T>() is true. More...
 
struct  MoveConstructible
 MoveConstructible concept, a type T is move constructible if meta::is_move_constructible<T>() is true. More...
 
struct  NonCopyable
 NonCopyable concept, a type is non copyable if it is neither copy constructible nor copy assignable. More...
 
struct  NonMovable
 NonMovable concept, a type is non movable if it is neither move constructible nor move assignable. More...
 
struct  NullablePointer
 NullablePointer concept, a type is said to be a nullable pointer type if its interactions w/ nullptr are defined and can be compared using operator!=. More...
 
struct  Predicate
 Predicate concept, a type F is a predicate with Args if it is RegularInvocable and its result is Boolean. More...
 
struct  Regular
 Regular concept, a type is Regular if it is SemiRegular and EqualityCOmparable. More...
 
struct  RegularInvocable
 RegularInvocable concept, a type F is regular invocable with Args if it is Invocable and is equality preserving and does not modify its arguments. More...
 
struct  Relation
 Relation concept, a type R is a relation between T and U if it defines the 4 combinations. More...
 
struct  Same
 Same concept, two types Lhs and Rhs are considered the same if meta::is_same<Lhs, Rhs>() is true. More...
 
struct  SemiRegular
 SemiRegular concept, a type is semi regular if it is Copyable and DefaultConstructible. More...
 
struct  Signed
 Signed concept, a type T is signed if meta::is_signed<T>() is true. More...
 
struct  SignedIntegral
 SignedIntegral concept, a type is a signed integral if it is both Integral and Signed. More...
 
struct  Swappable
 Swappable concept, a type is swappable if it defines swapping mecanisms. More...
 
struct  Unsigned
 Unsigned concept, a type T is unsigned if meta::is_unsigned<T>() is true. More...
 
struct  UnsignedIntegral
 UnsignedIntegral concept, a type is an unsigned integral if it is both Integral and Unsigned. More...
 
struct  ValueSwappable
 ValueSwappable concept, a type is value swappable if it is an iterator type and its value type is swappable. More...
 

Functions

template<class T >
constexpr bool is_concept ()
 Determine whether or not a given type is a concept-like type. More...
 
template<class ConceptType >
constexpr bool require (ConceptType c)
 Require a concept. More...
 

Detailed Description

A lightweight concept-like library for C++11.

Function Documentation

◆ is_concept()

template<class T >
constexpr bool scl::concepts::is_concept ( )

Determine whether or not a given type is a concept-like type.

Template Parameters
Tbeing the type to test
Returns
TRUE if it is a concept-like type, FALSE otherwise

Definition at line 28 of file is_concept.h.

◆ require()

template<class ConceptType >
constexpr bool scl::concepts::require ( ConceptType  c)

Require a concept.

Template Parameters
ConceptTypebeing the concept type to require (eg. Integral<T>)
Parameters
cbeing an instance of said ConceptType
Returns
true
Warning
Will not compile if the concept's requirements are not met

Definition at line 28 of file require.h.