ext-boost/boost/none_t.hpp

40 lines
953 B
C++
Raw Permalink Normal View History

2016-01-25 23:31:44 +00:00
// Copyright (C) 2003, Fernando Luis Cacciola Carballal.
2017-03-13 04:29:07 +00:00
// Copyright (C) 2014, 2015 Andrzej Krzemienski.
2016-01-25 23:31:44 +00:00
//
// Use, modification, and distribution is subject to the Boost Software
// License, Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at
// http://www.boost.org/LICENSE_1_0.txt)
//
// See http://www.boost.org/libs/optional for documentation.
//
// You are welcome to contact the author at:
// fernando_cacciola@hotmail.com
//
#ifndef BOOST_NONE_T_17SEP2003_HPP
#define BOOST_NONE_T_17SEP2003_HPP
namespace boost {
#ifdef BOOST_OPTIONAL_USE_OLD_DEFINITION_OF_NONE
2017-03-13 04:29:07 +00:00
2016-01-25 23:31:44 +00:00
namespace detail { struct none_helper{}; }
typedef int detail::none_helper::*none_t ;
2017-03-13 04:29:07 +00:00
#elif defined BOOST_OPTIONAL_USE_SINGLETON_DEFINITION_OF_NONE
2016-01-25 23:31:44 +00:00
class none_t {};
2017-03-13 04:29:07 +00:00
#else
struct none_t
{
struct init_tag{};
explicit none_t(init_tag){} // to disable default constructor
};
2016-01-25 23:31:44 +00:00
2017-03-13 04:29:07 +00:00
#endif // old implementation workarounds
} // namespace boost
2016-01-25 23:31:44 +00:00
2017-03-13 04:29:07 +00:00
#endif // header guard