Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-01-18 09:31:05

0001 
0002 // (C) Copyright Tobias Schwinger
0003 //
0004 // Use modification and distribution are subject to the boost Software License,
0005 // Version 1.0. (See http://www.boost.org/LICENSE_1_0.txt).
0006 
0007 //------------------------------------------------------------------------------
0008 
0009 #ifndef BOOST_FT_DETAIL_CLASSIFIER_HPP_INCLUDED
0010 #define BOOST_FT_DETAIL_CLASSIFIER_HPP_INCLUDED
0011 
0012 #include <boost/type.hpp>
0013 #include <boost/config.hpp>
0014 #include <boost/type_traits/is_reference.hpp>
0015 #include <boost/type_traits/add_reference.hpp>
0016 
0017 #include <boost/function_types/config/config.hpp>
0018 #include <boost/function_types/property_tags.hpp>
0019 
0020 namespace boost { namespace function_types { namespace detail {
0021 
0022 template<typename T> struct classifier;
0023 
0024 template<std::size_t S> struct char_array { typedef char (&type)[S]; };
0025 
0026 template<bits_t Flags, bits_t CCID, std::size_t Arity> struct encode_charr
0027 {
0028   typedef typename char_array<
0029     ::boost::function_types::detail::encode_charr_impl<Flags,CCID,Arity>::value 
0030   >::type type;
0031 };
0032 
0033 #if defined(BOOST_MSVC) || (defined(BOOST_BORLANDC) && !defined(BOOST_DISABLE_WIN32))
0034 #   define BOOST_FT_DECL __cdecl
0035 #else
0036 #   define BOOST_FT_DECL /**/
0037 #endif
0038 
0039 char BOOST_FT_DECL classifier_impl(...);
0040 
0041 #define BOOST_FT_variations BOOST_FT_function|BOOST_FT_pointer|\
0042                             BOOST_FT_member_pointer
0043 
0044 #define BOOST_FT_type_function(cc,name) BOOST_FT_SYNTAX( \
0045     R BOOST_PP_EMPTY,BOOST_PP_LPAREN,cc,* BOOST_PP_EMPTY,name,BOOST_PP_RPAREN)
0046 
0047 #define BOOST_FT_type_function_pointer(cc,name) BOOST_FT_SYNTAX( \
0048     R BOOST_PP_EMPTY,BOOST_PP_LPAREN,cc,** BOOST_PP_EMPTY,name,BOOST_PP_RPAREN)
0049 
0050 #define BOOST_FT_type_member_function_pointer(cc,name) BOOST_FT_SYNTAX( \
0051     R BOOST_PP_EMPTY,BOOST_PP_LPAREN,cc,T0::** BOOST_PP_EMPTY,name,BOOST_PP_RPAREN)
0052 
0053 #define BOOST_FT_al_path boost/function_types/detail/classifier_impl
0054 #include <boost/function_types/detail/pp_loop.hpp>
0055 
0056 template<typename T> struct classifier_bits
0057 {
0058   static typename boost::add_reference<T>::type tester;
0059 
0060   BOOST_STATIC_CONSTANT(bits_t,value = (bits_t)sizeof(
0061     boost::function_types::detail::classifier_impl(& tester) 
0062   )-1);
0063 };
0064 
0065 template<typename T> struct classifier
0066 {
0067   typedef detail::constant<
0068     ::boost::function_types::detail::decode_bits<
0069       ::boost::function_types::detail::classifier_bits<T>::value
0070     >::tag_bits > 
0071   bits;
0072 
0073   typedef detail::full_mask mask;
0074  
0075   typedef detail::constant<
0076     ::boost::function_types::detail::decode_bits<
0077       ::boost::function_types::detail::classifier_bits<T>::value
0078     >::arity > 
0079   function_arity;
0080 };
0081 
0082 
0083 
0084 } } } // namespace ::boost::function_types::detail
0085 
0086 #endif
0087