1 //-----------------------------------------------------------------------------
2 // boost variant/detail/forced_return.hpp header file
3 // See http://www.boost.org for updates, documentation, and revision history.
4 //-----------------------------------------------------------------------------
6 // Copyright (c) 2003 Eric Friedman
7 // Copyright (c) 2015-2019 Antony Polukhin
9 // Distributed under the Boost Software License, Version 1.0. (See
10 // accompanying file LICENSE_1_0.txt or copy at
11 // http://www.boost.org/LICENSE_1_0.txt)
13 #ifndef BOOST_VARIANT_DETAIL_FORCED_RETURN_HPP
14 #define BOOST_VARIANT_DETAIL_FORCED_RETURN_HPP
16 #include <boost/config.hpp>
17 #include <boost/assert.hpp>
21 # pragma warning( push )
22 # pragma warning( disable : 4702 ) // unreachable code
25 namespace boost { namespace detail { namespace variant {
27 ///////////////////////////////////////////////////////////////////////////////
28 // (detail) function template forced_return
30 // Logical error to permit invocation at runtime, but (artificially) satisfies
31 // compile-time requirement of returning a result value.
34 BOOST_NORETURN inline T
37 // logical error: should never be here! (see above)
42 BOOST_UNREACHABLE_RETURN(dummy());
45 }}} // namespace boost::detail::variant
49 # pragma warning( pop )
52 #endif // BOOST_VARIANT_DETAIL_FORCED_RETURN_HPP