Chris@16
|
1 /* Copyright 2006-2009 Joaquin M Lopez Munoz.
|
Chris@16
|
2 * Distributed under the Boost Software License, Version 1.0.
|
Chris@16
|
3 * (See accompanying file LICENSE_1_0.txt or copy at
|
Chris@16
|
4 * http://www.boost.org/LICENSE_1_0.txt)
|
Chris@16
|
5 *
|
Chris@16
|
6 * See http://www.boost.org/libs/flyweight for library home page.
|
Chris@16
|
7 */
|
Chris@16
|
8
|
Chris@16
|
9 #ifndef BOOST_FLYWEIGHT_DETAIL_IS_PLACEHOLDER_EXPR_HPP
|
Chris@16
|
10 #define BOOST_FLYWEIGHT_DETAIL_IS_PLACEHOLDER_EXPR_HPP
|
Chris@16
|
11
|
Chris@101
|
12 #if defined(_MSC_VER)
|
Chris@16
|
13 #pragma once
|
Chris@16
|
14 #endif
|
Chris@16
|
15
|
Chris@16
|
16 #include <boost/type_traits/is_same.hpp>
|
Chris@16
|
17 #include <boost/mpl/apply.hpp>
|
Chris@16
|
18 #include <boost/mpl/aux_/lambda_support.hpp>
|
Chris@16
|
19 #include <boost/mpl/not.hpp>
|
Chris@16
|
20 #include <boost/preprocessor/facilities/intercept.hpp>
|
Chris@16
|
21 #include <boost/preprocessor/repetition/enum_params.hpp>
|
Chris@16
|
22
|
Chris@16
|
23 namespace boost{
|
Chris@16
|
24
|
Chris@16
|
25 namespace flyweights{
|
Chris@16
|
26
|
Chris@16
|
27 namespace detail{
|
Chris@16
|
28
|
Chris@16
|
29 /* is_placeholder_expression<T> indicates whether T is an
|
Chris@16
|
30 * MPL placeholder expression.
|
Chris@16
|
31 */
|
Chris@16
|
32
|
Chris@16
|
33 template<typename T>
|
Chris@16
|
34 struct is_placeholder_expression_helper
|
Chris@16
|
35 {
|
Chris@16
|
36 template<
|
Chris@16
|
37 BOOST_PP_ENUM_PARAMS(
|
Chris@16
|
38 BOOST_MPL_LIMIT_METAFUNCTION_ARITY,typename BOOST_PP_INTERCEPT)
|
Chris@16
|
39 >
|
Chris@16
|
40 struct apply{
|
Chris@16
|
41 typedef int type;
|
Chris@16
|
42 };
|
Chris@16
|
43
|
Chris@16
|
44 BOOST_MPL_AUX_LAMBDA_SUPPORT(1,is_placeholder_expression_helper,(T))
|
Chris@16
|
45 };
|
Chris@16
|
46
|
Chris@16
|
47 template<typename T>
|
Chris@16
|
48 struct is_placeholder_expression:
|
Chris@16
|
49 mpl::not_<is_same<
|
Chris@16
|
50 typename mpl::apply<
|
Chris@16
|
51 is_placeholder_expression_helper<T>,
|
Chris@16
|
52 BOOST_PP_ENUM_PARAMS(
|
Chris@16
|
53 BOOST_MPL_LIMIT_METAFUNCTION_ARITY,int BOOST_PP_INTERCEPT)
|
Chris@16
|
54 >::type,
|
Chris@16
|
55 int
|
Chris@16
|
56 > >
|
Chris@16
|
57 {};
|
Chris@16
|
58
|
Chris@16
|
59 } /* namespace flyweights::detail */
|
Chris@16
|
60
|
Chris@16
|
61 } /* namespace flyweights */
|
Chris@16
|
62
|
Chris@16
|
63 } /* namespace boost */
|
Chris@16
|
64
|
Chris@16
|
65 #endif
|