Support Class Library
A set of tools providing classes and utility
ValueSwappable.h
Go to the documentation of this file.
1 #pragma once
2 
3 #include <scl/concepts/require.h>
6 #include <iterator>
7 
8 #define SCL_TRAIT(type) typename std::iterator_traits<T>::type
9 
10 namespace scl{
11  namespace concepts{
16  template <class T>
18  constexpr operator bool() const{
20  require(Swappable<SCL_TRAIT(value_type)>{});
21  return true;
22  }
23  };
24  }
25 }
Global namespace of the SCL.
Definition: alias.hpp:3
Swappable concept, a type is swappable if it defines swapping mecanisms.
Definition: Swappable.h:13
constexpr bool require(ConceptType c)
Require a concept.
Definition: require.h:28
#define SCL_TRAIT(type)
Definition: ValueSwappable.h:8
Iterator concept, a type is an iterator if it is copyable, destructible, swappable, has well-defined iterator_traits and can be incremented and dereferenced.
Definition: Iterator.h:22
ValueSwappable concept, a type is value swappable if it is an iterator type and its value type is swa...