Chris@16
|
1 // Copyright David Abrahams 2006. Distributed under the Boost
|
Chris@16
|
2 // Software License, Version 1.0. (See accompanying
|
Chris@16
|
3 // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
|
Chris@16
|
4 #ifndef BOOST_CONCEPT_DETAIL_CONCEPT_DEF_DWA200651_HPP
|
Chris@16
|
5 # define BOOST_CONCEPT_DETAIL_CONCEPT_DEF_DWA200651_HPP
|
Chris@16
|
6 # include <boost/preprocessor/seq/for_each_i.hpp>
|
Chris@16
|
7 # include <boost/preprocessor/seq/enum.hpp>
|
Chris@16
|
8 # include <boost/preprocessor/comma_if.hpp>
|
Chris@16
|
9 # include <boost/preprocessor/cat.hpp>
|
Chris@16
|
10 #endif // BOOST_CONCEPT_DETAIL_CONCEPT_DEF_DWA200651_HPP
|
Chris@16
|
11
|
Chris@16
|
12 // BOOST_concept(SomeName, (p1)(p2)...(pN))
|
Chris@16
|
13 //
|
Chris@16
|
14 // Expands to "template <class p1, class p2, ...class pN> struct SomeName"
|
Chris@16
|
15 //
|
Chris@16
|
16 // Also defines an equivalent SomeNameConcept for backward compatibility.
|
Chris@16
|
17 // Maybe in the next release we can kill off the "Concept" suffix for good.
|
Chris@16
|
18 # define BOOST_concept(name, params) \
|
Chris@16
|
19 template < BOOST_PP_SEQ_FOR_EACH_I(BOOST_CONCEPT_typename,~,params) > \
|
Chris@16
|
20 struct name; /* forward declaration */ \
|
Chris@16
|
21 \
|
Chris@16
|
22 template < BOOST_PP_SEQ_FOR_EACH_I(BOOST_CONCEPT_typename,~,params) > \
|
Chris@16
|
23 struct BOOST_PP_CAT(name,Concept) \
|
Chris@16
|
24 : name< BOOST_PP_SEQ_ENUM(params) > \
|
Chris@16
|
25 { \
|
Chris@16
|
26 }; \
|
Chris@16
|
27 \
|
Chris@16
|
28 template < BOOST_PP_SEQ_FOR_EACH_I(BOOST_CONCEPT_typename,~,params) > \
|
Chris@16
|
29 struct name
|
Chris@16
|
30
|
Chris@16
|
31 // Helper for BOOST_concept, above.
|
Chris@16
|
32 # define BOOST_CONCEPT_typename(r, ignored, index, t) \
|
Chris@16
|
33 BOOST_PP_COMMA_IF(index) typename t
|
Chris@16
|
34
|