1 // Copyright (C) 2003, Fernando Luis Cacciola Carballal.
2 // Copyright (C) 2014 Andrzej Krzemienski.
4 // Distributed under the Boost Software License, Version 1.0.
5 // (See accompanying file LICENSE_1_0.txt or copy at
6 // http://www.boost.org/LICENSE_1_0.txt)
8 // See http://www.boost.org/libs/optional for documentation.
10 // You are welcome to contact the author at:
11 // fernando_cacciola@hotmail.com
13 #ifndef BOOST_NONE_17SEP2003_HPP
14 #define BOOST_NONE_17SEP2003_HPP
16 #include "boost/none_t.hpp"
18 // NOTE: Borland users have to include this header outside any precompiled headers
19 // (bcc<=5.64 cannot include instance data in a precompiled header)
20 // -- * To be verified, now that there's no unnamed namespace
24 #ifdef BOOST_OPTIONAL_USE_OLD_DEFINITION_OF_NONE
25 none_t const none = (static_cast<none_t>(0)) ;
28 namespace detail { namespace optional_detail {
30 // the trick here is to make boost::none defined once as a global but in a header file
34 static const T instance;
38 const T none_instance<T>::instance = T(); // global, but because 'tis a template, no cpp file required
40 } } // namespace detail::optional_detail
45 const none_t& none = detail::optional_detail::none_instance<none_t>::instance;