New URL for NEMO forge!   http://forge.nemo-ocean.eu

Since March 2022 along with NEMO 4.2 release, the code development moved to a self-hosted GitLab.
This present forge is now archived and remained online for history.
is_xxx.hpp in vendors/XIOS/current/extern/boost/include/boost/detail – NEMO

source: vendors/XIOS/current/extern/boost/include/boost/detail/is_xxx.hpp @ 3408

Last change on this file since 3408 was 3408, checked in by rblod, 12 years ago

importing initial XIOS vendor drop

  • Property svn:keywords set to Id
File size: 3.2 KB
Line 
1// Copyright David Abrahams 2005. Distributed under the Boost
2// Software License, Version 1.0. (See accompanying
3// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
4#ifndef BOOST_DETAIL_IS_XXX_DWA20051011_HPP
5# define BOOST_DETAIL_IS_XXX_DWA20051011_HPP
6
7# include <boost/config.hpp>
8# include <boost/mpl/bool.hpp>
9# include <boost/preprocessor/enum_params.hpp>
10
11# if defined(BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION)
12# include <boost/type_traits/is_reference.hpp>
13# include <boost/type_traits/add_reference.hpp>
14
15#  define BOOST_DETAIL_IS_XXX_DEF(name, qualified_name, nargs)          \
16template <class X_>                                                     \
17struct is_##name                                                        \
18{                                                                       \
19    typedef char yes;                                                   \
20    typedef char (&no)[2];                                              \
21                                                                        \
22    static typename add_reference<X_>::type dummy;                      \
23                                                                        \
24    struct helpers                                                      \
25    {                                                                   \
26        template < BOOST_PP_ENUM_PARAMS_Z(1, nargs, class U) >          \
27        static yes test(                                                \
28           qualified_name< BOOST_PP_ENUM_PARAMS_Z(1, nargs, U) >&, int  \
29        );                                                              \
30                                                                        \
31        template <class U>                                              \
32        static no test(U&, ...);                                        \
33    };                                                                  \
34                                                                        \
35    BOOST_STATIC_CONSTANT(                                              \
36        bool, value                                                     \
37        = !is_reference<X_>::value                                      \
38        & (sizeof(helpers::test(dummy, 0)) == sizeof(yes)));            \
39                                                                        \
40    typedef mpl::bool_<value> type;                                     \
41};
42
43# else
44
45#  define BOOST_DETAIL_IS_XXX_DEF(name, qualified_name, nargs)  \
46template <class T>                                              \
47struct is_##name : mpl::false_                                  \
48{                                                               \
49};                                                              \
50                                                                \
51template < BOOST_PP_ENUM_PARAMS_Z(1, nargs, class T) >          \
52struct is_##name<                                               \
53   qualified_name< BOOST_PP_ENUM_PARAMS_Z(1, nargs, T) >        \
54>                                                               \
55   : mpl::true_                                                 \
56{                                                               \
57};
58
59# endif
60
61#endif // BOOST_DETAIL_IS_XXX_DWA20051011_HPP
Note: See TracBrowser for help on using the repository browser.