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)
8 * \file native_typeof.hpp
9 * \author Andrey Semashev
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.
16 #ifndef BOOST_LOG_DETAIL_NATIVE_TYPEOF_HPP_INCLUDED_
17 #define BOOST_LOG_DETAIL_NATIVE_TYPEOF_HPP_INCLUDED_
19 #include <boost/log/detail/config.hpp>
21 #ifdef BOOST_HAS_PRAGMA_ONCE
25 #if !defined(BOOST_NO_CXX11_DECLTYPE)
29 BOOST_LOG_OPEN_NAMESPACE
33 template< typename T >
34 T get_root_type(T const&);
38 BOOST_LOG_CLOSE_NAMESPACE // namespace log
42 #define BOOST_LOG_TYPEOF(x) decltype(::boost::log::aux::get_root_type(x))
44 #elif defined(__COMO__) && defined(__GNUG__)
46 #define BOOST_LOG_TYPEOF(x) typeof(x)
48 #elif defined(__GNUC__) || defined(__MWERKS__)
50 #define BOOST_LOG_TYPEOF(x) __typeof__(x)
55 #if !defined(BOOST_NO_CXX11_AUTO_DECLARATIONS)
56 #define BOOST_LOG_AUTO(var, expr) auto var = (expr)
59 #if !defined(BOOST_LOG_AUTO) && defined(BOOST_LOG_TYPEOF)
60 #define BOOST_LOG_AUTO(var, expr) BOOST_LOG_TYPEOF((expr)) var = (expr)
63 #endif // BOOST_LOG_DETAIL_NATIVE_TYPEOF_HPP_INCLUDED_