forked from boostorg/optional
boost::none - simpler and works with MSVC
This commit is contained in:
1 parent
02ed4eadd8
commit
1dd2c422ca
8 files changed
+66
-18
No files matched your search
@@ -16,13 +16,25 @@
|
||||
namespace boost {
|
||||
|
||||
#ifdef BOOST_OPTIONAL_USE_OLD_DEFINITION_OF_NONE
|
||||
|
||||
namespace detail { struct none_helper{}; }
|
||||
typedef int detail::none_helper::*none_t ;
|
||||
#else
|
||||
|
||||
#elif defined BOOST_OPTIONAL_USE_SINGLETON_DEFINITION_OF_NONE
|
||||
|
||||
class none_t {};
|
||||
#endif
|
||||
|
||||
#else
|
||||
|
||||
struct none_t
|
||||
{
|
||||
struct init_tag{};
|
||||
explicit none_t(init_tag){} // to prevent default constructor
|
||||
};
|
||||
|
||||
#endif // old implementation workarounds
|
||||
|
||||
} // namespace boost
|
||||
|
||||
#endif
|
||||
#endif // header guard
|
||||
|
||||
Reference in new issue
Block a user