Mercurial > hg > vamp-build-and-test
annotate DEPENDENCIES/generic/include/boost/none.hpp @ 125:34e428693f5d vext
Vext -> Repoint
author | Chris Cannam |
---|---|
date | Thu, 14 Jun 2018 11:15:39 +0100 |
parents | c530137014c0 |
children |
rev | line source |
---|---|
Chris@16 | 1 // Copyright (C) 2003, Fernando Luis Cacciola Carballal. |
Chris@101 | 2 // Copyright (C) 2014 Andrzej Krzemienski. |
Chris@16 | 3 // |
Chris@16 | 4 // Distributed under the Boost Software License, Version 1.0. |
Chris@16 | 5 // (See accompanying file LICENSE_1_0.txt or copy at |
Chris@16 | 6 // http://www.boost.org/LICENSE_1_0.txt) |
Chris@16 | 7 // |
Chris@16 | 8 // See http://www.boost.org/libs/optional for documentation. |
Chris@16 | 9 // |
Chris@16 | 10 // You are welcome to contact the author at: |
Chris@16 | 11 // fernando_cacciola@hotmail.com |
Chris@16 | 12 // |
Chris@16 | 13 #ifndef BOOST_NONE_17SEP2003_HPP |
Chris@16 | 14 #define BOOST_NONE_17SEP2003_HPP |
Chris@16 | 15 |
Chris@16 | 16 #include "boost/none_t.hpp" |
Chris@16 | 17 |
Chris@16 | 18 // NOTE: Borland users have to include this header outside any precompiled headers |
Chris@16 | 19 // (bcc<=5.64 cannot include instance data in a precompiled header) |
Chris@16 | 20 // -- * To be verified, now that there's no unnamed namespace |
Chris@16 | 21 |
Chris@16 | 22 namespace boost { |
Chris@16 | 23 |
Chris@101 | 24 #ifdef BOOST_OPTIONAL_USE_OLD_DEFINITION_OF_NONE |
Chris@16 | 25 none_t const none = (static_cast<none_t>(0)) ; |
Chris@101 | 26 #else |
Chris@101 | 27 |
Chris@101 | 28 namespace detail { namespace optional_detail { |
Chris@101 | 29 |
Chris@101 | 30 // the trick here is to make boost::none defined once as a global but in a header file |
Chris@101 | 31 template <typename T> |
Chris@101 | 32 struct none_instance |
Chris@101 | 33 { |
Chris@101 | 34 static const T instance; |
Chris@101 | 35 }; |
Chris@101 | 36 |
Chris@101 | 37 template <typename T> |
Chris@101 | 38 const T none_instance<T>::instance = T(); // global, but because 'tis a template, no cpp file required |
Chris@101 | 39 |
Chris@101 | 40 } } // namespace detail::optional_detail |
Chris@101 | 41 |
Chris@101 | 42 |
Chris@101 | 43 namespace { |
Chris@101 | 44 // TU-local |
Chris@101 | 45 const none_t& none = detail::optional_detail::none_instance<none_t>::instance; |
Chris@101 | 46 } |
Chris@101 | 47 |
Chris@101 | 48 #endif |
Chris@16 | 49 |
Chris@16 | 50 } // namespace boost |
Chris@16 | 51 |
Chris@16 | 52 #endif |
Chris@16 | 53 |