]> git.proxmox.com Git - ceph.git/blame - ceph/src/boost/boost/typeof/native.hpp
import new upstream nautilus stable release 14.2.8
[ceph.git] / ceph / src / boost / boost / typeof / native.hpp
CommitLineData
7c673cae
FG
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)
4
5#ifndef BOOST_TYPEOF_NATIVE_HPP_INCLUDED
6#define BOOST_TYPEOF_NATIVE_HPP_INCLUDED
7
8#ifndef MSVC_TYPEOF_HACK
9
10#ifdef BOOST_NO_SFINAE
11
12namespace boost { namespace type_of {
13
14 template<class T>
15 T& ensure_obj(const T&);
16
17}}
18
19#else
20
92f5a8d4 21#include <boost/type_traits/enable_if.hpp>
7c673cae 22#include <boost/type_traits/is_function.hpp>
7c673cae
FG
23
24namespace boost { namespace type_of {
25# ifdef BOOST_NO_SFINAE
26 template<class T>
27 T& ensure_obj(const T&);
28# else
29 template<typename T>
92f5a8d4 30 typename enable_if_<is_function<T>::value, T&>::type
7c673cae
FG
31 ensure_obj(T&);
32
33 template<typename T>
92f5a8d4 34 typename enable_if_<!is_function<T>::value, T&>::type
7c673cae
FG
35 ensure_obj(const T&);
36# endif
37}}
38
39#endif//BOOST_NO_SFINAE
40
41#define BOOST_TYPEOF(expr) BOOST_TYPEOF_KEYWORD(boost::type_of::ensure_obj(expr))
42#define BOOST_TYPEOF_TPL BOOST_TYPEOF
43
44#define BOOST_TYPEOF_NESTED_TYPEDEF_TPL(name,expr) \
45 struct name {\
46 typedef BOOST_TYPEOF_TPL(expr) type;\
47 };
48
49#define BOOST_TYPEOF_NESTED_TYPEDEF(name,expr) \
50 struct name {\
51 typedef BOOST_TYPEOF(expr) type;\
52 };
53
54#endif//MSVC_TYPEOF_HACK
55
56#define BOOST_TYPEOF_REGISTER_TYPE(x)
57#define BOOST_TYPEOF_REGISTER_TEMPLATE(x, params)
58
59#endif//BOOST_TYPEOF_NATIVE_HPP_INCLUDED
60