• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 // Boost.TypeErasure library
2 //
3 // Copyright 2011 Steven Watanabe
4 //
5 // Distributed under the Boost Software License Version 1.0. (See
6 // accompanying file LICENSE_1_0.txt or copy at
7 // http://www.boost.org/LICENSE_1_0.txt)
8 //
9 // $Id$
10 
11 #include <boost/type_erasure/builtin.hpp>
12 #include <boost/type_erasure/operators.hpp>
13 #include <boost/mpl/vector.hpp>
14 
15 namespace mpl = boost::mpl;
16 using namespace boost::type_erasure;
17 
18 //[compose1
19 /*`
20     Multiple concepts can be composed using an MPL sequence.
21 */
22 template<class T = _self>
23 struct arithmetic :
24     mpl::vector<
25         copy_constructible<T>,
26         addable<T>,
27         subtractable<T>,
28         multipliable<T>,
29         dividable<T>,
30         equality_comparable<T>,
31         less_than_comparable<T>
32     >
33 {};
34 /*`
35     Now, `arithmetic` is a concept that can be used just
36     like any of the base concepts.
37 */
38 //]
39 
40 //[compose
41 //` (For the source of the examples in this section see
42 //` [@boost:/libs/type_erasure/example/compose.cpp compose.cpp])
43 //` [compose1]
44 //]
45