Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-01-18 09:30:52

0001 /* Copyright 2006-2009 Joaquin M Lopez Munoz.
0002  * Distributed under the Boost Software License, Version 1.0.
0003  * (See accompanying file LICENSE_1_0.txt or copy at
0004  * http://www.boost.org/LICENSE_1_0.txt)
0005  *
0006  * See http://www.boost.org/libs/flyweight for library home page.
0007  */
0008 
0009 #ifndef BOOST_FLYWEIGHT_DETAIL_NESTED_XXX_IF_NOT_PH_HPP
0010 #define BOOST_FLYWEIGHT_DETAIL_NESTED_XXX_IF_NOT_PH_HPP
0011 
0012 #if defined(_MSC_VER)
0013 #pragma once
0014 #endif
0015 
0016 #include <boost/flyweight/detail/is_placeholder_expr.hpp>
0017 #include <boost/mpl/if.hpp>
0018 
0019 /* nested_##name##_if_not_placeholder_expression<T>::type is T::name unless
0020  * T is an MPL placeholder expression, in which case it defaults to int.
0021  */
0022 
0023 #define BOOST_FLYWEIGHT_NESTED_XXX_IF_NOT_PLACEHOLDER_EXPRESSION_DEF(name) \
0024 struct nested_##name##_if_not_placeholder_expression_helper                \
0025 {                                                                          \
0026   typedef int name;                                                        \
0027 };                                                                         \
0028                                                                            \
0029 template<typename T>                                                       \
0030 struct nested_##name##_if_not_placeholder_expression                       \
0031 {                                                                          \
0032   typedef typename boost::mpl::if_<                                        \
0033     boost::flyweights::detail::is_placeholder_expression<T>,               \
0034     nested_##name##_if_not_placeholder_expression_helper,                  \
0035     T                                                                      \
0036   >::type::name type;                                                      \
0037 };
0038 
0039 #endif