]>
Commit | Line | Data |
---|---|---|
7c673cae FG |
1 | /* |
2 | * Copyright Andrey Semashev 2007 - 2015. | |
3 | * Distributed under the Boost Software License, Version 1.0. | |
4 | * (See accompanying file LICENSE_1_0.txt or copy at | |
5 | * http://www.boost.org/LICENSE_1_0.txt) | |
6 | */ | |
7 | /*! | |
8 | * \file native_typeof.hpp | |
9 | * \author Andrey Semashev | |
10 | * \date 08.03.2009 | |
11 | * | |
12 | * This header is the Boost.Log library implementation, see the library documentation | |
13 | * at http://www.boost.org/doc/libs/release/libs/log/doc/html/index.html. | |
14 | */ | |
15 | ||
16 | #ifndef BOOST_LOG_DETAIL_NATIVE_TYPEOF_HPP_INCLUDED_ | |
17 | #define BOOST_LOG_DETAIL_NATIVE_TYPEOF_HPP_INCLUDED_ | |
18 | ||
19 | #include <boost/log/detail/config.hpp> | |
20 | ||
21 | #ifdef BOOST_HAS_PRAGMA_ONCE | |
22 | #pragma once | |
23 | #endif | |
24 | ||
25 | #if !defined(BOOST_NO_CXX11_DECLTYPE) | |
26 | ||
27 | namespace boost { | |
28 | ||
29 | BOOST_LOG_OPEN_NAMESPACE | |
30 | ||
31 | namespace aux { | |
32 | ||
33 | template< typename T > | |
34 | T get_root_type(T const&); | |
35 | ||
36 | } // namespace aux | |
37 | ||
38 | BOOST_LOG_CLOSE_NAMESPACE // namespace log | |
39 | ||
40 | } // namespace boost | |
41 | ||
42 | #define BOOST_LOG_TYPEOF(x) decltype(::boost::log::aux::get_root_type(x)) | |
43 | ||
44 | #elif defined(__COMO__) && defined(__GNUG__) | |
45 | ||
46 | #define BOOST_LOG_TYPEOF(x) typeof(x) | |
47 | ||
48 | #elif defined(__GNUC__) || defined(__MWERKS__) | |
49 | ||
50 | #define BOOST_LOG_TYPEOF(x) __typeof__(x) | |
51 | ||
52 | #endif | |
53 | ||
54 | ||
55 | #if !defined(BOOST_NO_CXX11_AUTO_DECLARATIONS) | |
56 | #define BOOST_LOG_AUTO(var, expr) auto var = (expr) | |
57 | #endif | |
58 | ||
59 | #if !defined(BOOST_LOG_AUTO) && defined(BOOST_LOG_TYPEOF) | |
60 | #define BOOST_LOG_AUTO(var, expr) BOOST_LOG_TYPEOF((expr)) var = (expr) | |
61 | #endif | |
62 | ||
63 | #endif // BOOST_LOG_DETAIL_NATIVE_TYPEOF_HPP_INCLUDED_ |