1
0
forked from boostorg/core

Qualify empty_init_t and use_empty_value_base

This commit is contained in:
Glen Fernandes
2018-10-01 00:46:43 -04:00
parent 5ed58ee20f
commit 1d9d6f579e
2 changed files with 14 additions and 13 deletions

View File

@@ -92,9 +92,9 @@ public:
template<class... Args>
explicit empty_value(empty_init_t, Args&&... args);
const T& get() const;
const T& get() const noexcept;
T& get();
T& get() noexcept;
};
} /* boost */
@@ -127,8 +127,8 @@ public:
[section Member functions]
[variablelist
[[`const T& get() const;`][Returns the value]]
[[`T& get();`][Returns the value]]]
[[`const T& get() const noexcept;`][Returns the value]]
[[`T& get() noexcept;`][Returns the value]]]
[endsect]

View File

@@ -42,7 +42,8 @@ struct empty_init_t { };
namespace empty_ {
template<class T, unsigned N = 0, bool E = use_empty_value_base<T>::value>
template<class T, unsigned N = 0,
bool E = boost::use_empty_value_base<T>::value>
class empty_value {
public:
typedef T type;
@@ -53,22 +54,22 @@ public:
empty_value() { }
#endif
empty_value(empty_init_t)
empty_value(boost::empty_init_t)
: value_() { }
#if !defined(BOOST_NO_CXX11_RVALUE_REFERENCES)
#if !defined(BOOST_NO_CXX11_VARIADIC_TEMPLATES)
template<class... Args>
explicit empty_value(empty_init_t, Args&&... args)
explicit empty_value(boost::empty_init_t, Args&&... args)
: value_(std::forward<Args>(args)...) { }
#else
template<class U>
empty_value(empty_init_t, U&& value)
empty_value(boost::empty_init_t, U&& value)
: value_(std::forward<U>(value)) { }
#endif
#else
template<class U>
empty_value(empty_init_t, const U& value)
empty_value(boost::empty_init_t, const U& value)
: value_(value) { }
#endif
@@ -97,22 +98,22 @@ public:
empty_value() { }
#endif
empty_value(empty_init_t)
empty_value(boost::empty_init_t)
: T() { }
#if !defined(BOOST_NO_CXX11_RVALUE_REFERENCES)
#if !defined(BOOST_NO_CXX11_VARIADIC_TEMPLATES)
template<class... Args>
explicit empty_value(empty_init_t, Args&&... args)
explicit empty_value(boost::empty_init_t, Args&&... args)
: T(std::forward<Args>(args)...) { }
#else
template<class U>
empty_value(empty_init_t, U&& value)
empty_value(boost::empty_init_t, U&& value)
: T(std::forward<U>(value)) { }
#endif
#else
template<class U>
empty_value(empty_init_t, const U& value)
empty_value(boost::empty_init_t, const U& value)
: T(value) { }
#endif