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.
general.hpp in vendors/XIOS/current/extern/boost/include/boost/concept/detail – NEMO

source: vendors/XIOS/current/extern/boost/include/boost/concept/detail/general.hpp @ 3428

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

importing initial XIOS vendor drop

File size: 1.8 KB
Line 
1// Copyright David Abrahams 2006. 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_CONCEPT_DETAIL_GENERAL_DWA2006429_HPP
5# define BOOST_CONCEPT_DETAIL_GENERAL_DWA2006429_HPP
6
7# include <boost/preprocessor/cat.hpp>
8# include <boost/concept/detail/backward_compatibility.hpp>
9
10# ifdef BOOST_OLD_CONCEPT_SUPPORT
11#  include <boost/concept/detail/has_constraints.hpp>
12#  include <boost/mpl/if.hpp>
13# endif
14
15// This implementation works on Comeau and GCC, all the way back to
16// 2.95
17namespace boost { namespace concepts {
18
19template <class ModelFn>
20struct requirement_;
21
22namespace detail
23{
24  template <void(*)()> struct instantiate {};
25}
26
27template <class Model>
28struct requirement
29{
30    static void failed() { ((Model*)0)->~Model(); }
31};
32
33struct failed {};
34
35template <class Model>
36struct requirement<failed ************ Model::************>
37{
38    static void failed() { ((Model*)0)->~Model(); }
39};
40
41# ifdef BOOST_OLD_CONCEPT_SUPPORT
42
43template <class Model>
44struct constraint
45{
46    static void failed() { ((Model*)0)->constraints(); }
47};
48 
49template <class Model>
50struct requirement_<void(*)(Model)>
51  : mpl::if_<
52        concepts::not_satisfied<Model>
53      , constraint<Model>
54      , requirement<failed ************ Model::************>
55    >::type
56{};
57 
58# else
59
60// For GCC-2.x, these can't have exactly the same name
61template <class Model>
62struct requirement_<void(*)(Model)>
63    : requirement<failed ************ Model::************>
64{};
65 
66# endif
67
68#  define BOOST_CONCEPT_ASSERT_FN( ModelFnPtr )             \
69    typedef ::boost::concepts::detail::instantiate<          \
70    &::boost::concepts::requirement_<ModelFnPtr>::failed>    \
71      BOOST_PP_CAT(boost_concept_check,__LINE__)
72
73}}
74
75#endif // BOOST_CONCEPT_DETAIL_GENERAL_DWA2006429_HPP
Note: See TracBrowser for help on using the repository browser.