mirror of
https://github.com/boostorg/optional.git
synced 2025-07-29 12:07:21 +02:00
Updated single-header implementation
[SVN r37420]
This commit is contained in:
@ -1,4 +1,6 @@
|
|||||||
// Copyright (C) 2003, Fernando Luis Cacciola Carballal.
|
// Copyright (C) 2003, Fernando Luis Cacciola Carballal.
|
||||||
|
// Copyright (C) 2007, Anthony Williams
|
||||||
|
// Copyright (C) 2007, Steven Watanabe, Richard Smith
|
||||||
//
|
//
|
||||||
// Distributed under the Boost Software License, Version 1.0.
|
// Distributed under the Boost Software License, Version 1.0.
|
||||||
// (See accompanying file LICENSE_1_0.txt or copy at
|
// (See accompanying file LICENSE_1_0.txt or copy at
|
||||||
@ -7,30 +9,35 @@
|
|||||||
// See http://www.boost.org/lib/optional/ for documentation.
|
// See http://www.boost.org/lib/optional/ for documentation.
|
||||||
//
|
//
|
||||||
// You are welcome to contact the author at:
|
// You are welcome to contact the author at:
|
||||||
// fernando_cacciola@hotmail.com
|
// fernando.cacciola@gmail.com
|
||||||
//
|
//
|
||||||
#ifndef BOOST_NONE_17SEP2003_HPP
|
#ifndef BOOST_NONE_17SEP2003_HPP
|
||||||
#define BOOST_NONE_17SEP2003_HPP
|
#define BOOST_NONE_17SEP2003_HPP
|
||||||
|
|
||||||
#include <boost/detail/workaround.hpp>
|
namespace boost
|
||||||
|
{
|
||||||
|
namespace detail
|
||||||
|
{
|
||||||
|
class none_helper;
|
||||||
|
}
|
||||||
|
|
||||||
namespace boost {
|
inline void none(detail::none_helper);
|
||||||
|
|
||||||
#if BOOST_WORKAROUND(__BORLANDC__, <= 0x564)
|
namespace detail
|
||||||
|
{
|
||||||
|
class none_helper
|
||||||
|
{
|
||||||
|
private:
|
||||||
|
|
||||||
namespace detail { struct none_helper{}; }
|
none_helper( none_helper const& ) {}
|
||||||
|
|
||||||
typedef int detail::none_helper::*none_t ;
|
friend void boost::none(none_helper);
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
none_t const none = ((none_t)0) ;
|
typedef void (*none_t)(detail::none_helper);
|
||||||
|
|
||||||
#else
|
inline void none(detail::none_helper) {}
|
||||||
|
}
|
||||||
enum none_t {none = 0};
|
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
} // namespace boost
|
|
||||||
|
|
||||||
#endif
|
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user