1 // Copyright (C) 2006 Arkadiy Vertleyb
2 // Use, modification and distribution is subject to the Boost Software
3 // License, Version 1.0. (http://www.boost.org/LICENSE_1_0.txt)
5 #ifndef BOOST_TYPEOF_NATIVE_HPP_INCLUDED
6 #define BOOST_TYPEOF_NATIVE_HPP_INCLUDED
8 #ifndef MSVC_TYPEOF_HACK
10 #ifdef BOOST_NO_SFINAE
12 namespace boost
{ namespace type_of
{
15 T
& ensure_obj(const T
&);
21 #include <boost/type_traits/is_function.hpp>
22 #include <boost/utility/enable_if.hpp>
24 namespace boost
{ namespace type_of
{
25 # ifdef BOOST_NO_SFINAE
27 T
& ensure_obj(const T
&);
30 typename enable_if
<is_function
<T
>, T
&>::type
34 typename disable_if
<is_function
<T
>, T
&>::type
39 #endif//BOOST_NO_SFINAE
41 #define BOOST_TYPEOF(expr) BOOST_TYPEOF_KEYWORD(boost::type_of::ensure_obj(expr))
42 #define BOOST_TYPEOF_TPL BOOST_TYPEOF
44 #define BOOST_TYPEOF_NESTED_TYPEDEF_TPL(name,expr) \
46 typedef BOOST_TYPEOF_TPL(expr) type;\
49 #define BOOST_TYPEOF_NESTED_TYPEDEF(name,expr) \
51 typedef BOOST_TYPEOF(expr) type;\
54 #endif//MSVC_TYPEOF_HACK
56 #define BOOST_TYPEOF_REGISTER_TYPE(x)
57 #define BOOST_TYPEOF_REGISTER_TEMPLATE(x, params)
59 #endif//BOOST_TYPEOF_NATIVE_HPP_INCLUDED