]> git.proxmox.com Git - ceph.git/blob - ceph/src/boost/boost/type_erasure/detail/null.hpp
update sources to ceph Nautilus 14.2.1
[ceph.git] / ceph / src / boost / boost / type_erasure / detail / null.hpp
1 // Boost.TypeErasure library
2 //
3 // Copyright 2012 Steven Watanabe
4 //
5 // Distributed under the Boost Software License Version 1.0. (See
6 // accompanying file LICENSE_1_0.txt or copy at
7 // http://www.boost.org/LICENSE_1_0.txt)
8 //
9 // $Id$
10
11 #if !defined(BOOST_PP_IS_ITERATING)
12
13 #ifndef BOOST_TYPE_ERASURE_DETAIL_NULL_HPP_INCLUDED
14 #define BOOST_TYPE_ERASURE_DETAIL_NULL_HPP_INCLUDED
15
16 #include <boost/config.hpp>
17 #include <boost/throw_exception.hpp>
18 #include <boost/type_traits/remove_pointer.hpp>
19 #include <boost/preprocessor/iteration/iterate.hpp>
20 #include <boost/preprocessor/repetition/enum_params.hpp>
21 #include <boost/preprocessor/repetition/enum_trailing_params.hpp>
22 #include <boost/type_erasure/config.hpp>
23 #include <boost/type_erasure/exception.hpp>
24
25 namespace boost {
26 namespace type_erasure {
27 namespace detail {
28
29 template<class Sig>
30 struct null_throw;
31
32 template<class Concept>
33 struct get_null_vtable_entry {
34 typedef ::boost::type_erasure::detail::null_throw<
35 typename ::boost::remove_pointer<typename Concept::type>::type> type;
36 };
37
38 #ifdef BOOST_NO_CXX11_VARIADIC_TEMPLATES
39
40 #define BOOST_PP_FILENAME_1 <boost/type_erasure/detail/null.hpp>
41 #define BOOST_PP_ITERATION_LIMITS (0, BOOST_TYPE_ERASURE_MAX_ARITY)
42 #include BOOST_PP_ITERATE()
43
44 #else
45
46 template<class R, class... T>
47 struct null_throw<R(T...)> {
48 static R value(T...) {
49 BOOST_THROW_EXCEPTION(::boost::type_erasure::bad_function_call());
50 }
51 };
52
53 #endif
54
55 }
56 }
57 }
58
59 #endif
60
61 #else
62
63 #define N BOOST_PP_ITERATION()
64
65 template<class R BOOST_PP_ENUM_TRAILING_PARAMS(N, class T)>
66 struct null_throw<R(BOOST_PP_ENUM_PARAMS(N, T))> {
67 static R value(BOOST_PP_ENUM_PARAMS(N, T)) {
68 BOOST_THROW_EXCEPTION(::boost::type_erasure::bad_function_call());
69 }
70 };
71
72 #undef N
73
74 #endif