Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-01-30 10:01:22

0001 // Boost.TypeErasure library
0002 //
0003 // Copyright 2012 Steven Watanabe
0004 //
0005 // Distributed under the Boost Software License Version 1.0. (See
0006 // accompanying file LICENSE_1_0.txt or copy at
0007 // http://www.boost.org/LICENSE_1_0.txt)
0008 //
0009 // $Id$
0010 
0011 #if !defined(BOOST_PP_IS_ITERATING)
0012 
0013 #ifndef BOOST_TYPE_ERASURE_DETAIL_NULL_HPP_INCLUDED
0014 #define BOOST_TYPE_ERASURE_DETAIL_NULL_HPP_INCLUDED
0015 
0016 #include <boost/config.hpp>
0017 #include <boost/throw_exception.hpp>
0018 #include <boost/type_traits/remove_pointer.hpp>
0019 #include <boost/preprocessor/iteration/iterate.hpp>
0020 #include <boost/preprocessor/repetition/enum_params.hpp>
0021 #include <boost/preprocessor/repetition/enum_trailing_params.hpp>
0022 #include <boost/type_erasure/config.hpp>
0023 #include <boost/type_erasure/exception.hpp>
0024 
0025 namespace boost {
0026 namespace type_erasure {
0027 namespace detail {
0028 
0029 template<class Sig>
0030 struct null_throw;
0031 
0032 template<class Concept>
0033 struct get_null_vtable_entry {
0034     typedef ::boost::type_erasure::detail::null_throw<
0035         typename ::boost::remove_pointer<typename Concept::type>::type> type;
0036 };
0037 
0038 #ifdef BOOST_NO_CXX11_VARIADIC_TEMPLATES
0039 
0040 #define BOOST_PP_FILENAME_1 <boost/type_erasure/detail/null.hpp>
0041 #define BOOST_PP_ITERATION_LIMITS (0, BOOST_TYPE_ERASURE_MAX_ARITY)
0042 #include BOOST_PP_ITERATE()
0043 
0044 #else
0045 
0046 template<class R, class... T>
0047 struct null_throw<R(T...)> {
0048     static R value(T...) { 
0049         BOOST_THROW_EXCEPTION(::boost::type_erasure::bad_function_call());
0050     }
0051 };
0052 
0053 #endif
0054 
0055 }
0056 }
0057 }
0058 
0059 #endif
0060 
0061 #else
0062 
0063 #define N BOOST_PP_ITERATION()
0064 
0065 template<class R BOOST_PP_ENUM_TRAILING_PARAMS(N, class T)>
0066 struct null_throw<R(BOOST_PP_ENUM_PARAMS(N, T))> {
0067     static R value(BOOST_PP_ENUM_PARAMS(N, T)) { 
0068         BOOST_THROW_EXCEPTION(::boost::type_erasure::bad_function_call());
0069     }
0070 };
0071 
0072 #undef N
0073 
0074 #endif