All Classes Namespaces Files Functions Variables Typedefs Enumerations Friends Macros Pages
concepts.hpp
Go to the documentation of this file.
1 //=======================================================================
2 // Copyright (c) 2013 Robert Rosolek
3 //
4 // Distributed under the Boost Software License, Version 1.0. (See
5 // accompanying file LICENSE_1_0.txt or copy at
6 // http://www.boost.org/LICENSE_1_0.txt)
7 //=======================================================================
15 #ifndef PAAL_CONCEPTS_HPP
16 #define PAAL_CONCEPTS_HPP
17 
18 #include <boost/concept_check.hpp>
19 #include <boost/range/concepts.hpp>
20 #include <boost/range/iterator.hpp>
21 
22 #include <type_traits>
23 #include <utility>
24 
25 namespace paal {
26 namespace utils {
28 namespace concepts {
29 
35 template <class T>
37  static_assert(std::is_floating_point<T>::value,
38  "T is not floating point!");
39 };
40 
46 template <class T>
48  static_assert(std::is_move_constructible<T>::value,
49  "T is not move constructible!");
50 };
51 
60 template <class Iter, class Val>
62  Iter iter;
63  Val val;
64 
65  public:
66  BOOST_CONCEPT_USAGE(output_iterator)
67  {
68  *iter = std::move(val);
69  ++iter;
70  }
71 };
72 
78 template<class T>
80  BOOST_CONCEPT_ASSERT((boost_concepts::ReadableIteratorConcept<
81  typename boost::range_iterator<T>::type>));
82 };
83 
84 
85 }
86 }
87 }
88 
89 #endif /* PAAL_CONCEPTS_HPP */
Concept class for output iterator concept. We don&#39;t use boost::OutputIterator concept as it excludes ...
Definition: concepts.hpp:61
Concept class for floating point types.
Definition: concepts.hpp:36
Concept class for readable range concept.
Definition: concepts.hpp:79
Concept class for move constructible types.
Definition: concepts.hpp:47