mirror of
https://github.com/boostorg/core.git
synced 2025-05-09 23:03:54 +00:00
Fix MSVC issue with deriving from empty_value
This commit is contained in:
parent
c056f3dfc9
commit
e22bd49fa7
@ -95,9 +95,53 @@ private:
|
||||
};
|
||||
|
||||
#if !defined(BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION)
|
||||
#if defined(BOOST_MSVC)
|
||||
namespace detail {
|
||||
|
||||
template<class T>
|
||||
class empty_value_base
|
||||
: public T {
|
||||
public:
|
||||
#if !defined(BOOST_NO_CXX11_DEFAULTED_FUNCTIONS)
|
||||
empty_value_base() = default;
|
||||
#else
|
||||
BOOST_CONSTEXPR empty_value_base() { }
|
||||
#endif
|
||||
|
||||
#if !defined(BOOST_NO_CXX11_RVALUE_REFERENCES)
|
||||
#if !defined(BOOST_NO_CXX11_VARIADIC_TEMPLATES)
|
||||
template<class U, class... Args>
|
||||
BOOST_CONSTEXPR empty_value_base(U&& value, Args&&... args)
|
||||
: T(std::forward<U>(value), std::forward<Args>(args)...) { }
|
||||
#else
|
||||
template<class U>
|
||||
BOOST_CONSTEXPR empty_value_base(U&& value)
|
||||
: T(std::forward<U>(value)) { }
|
||||
#endif
|
||||
#else
|
||||
template<class U>
|
||||
BOOST_CONSTEXPR empty_value_base(const U& value)
|
||||
: T(value) { }
|
||||
|
||||
template<class U>
|
||||
BOOST_CONSTEXPR empty_value_base(U& value)
|
||||
: T(value) { }
|
||||
#endif
|
||||
};
|
||||
|
||||
} /* detail */
|
||||
#endif
|
||||
|
||||
template<class T, unsigned N>
|
||||
class empty_value<T, N, true>
|
||||
#if defined(BOOST_MSVC)
|
||||
: detail::empty_value_base<T> {
|
||||
typedef detail::empty_value_base<T> base;
|
||||
#else
|
||||
: T {
|
||||
typedef T base;
|
||||
#endif
|
||||
|
||||
public:
|
||||
typedef T type;
|
||||
|
||||
@ -108,26 +152,26 @@ public:
|
||||
#endif
|
||||
|
||||
BOOST_CONSTEXPR empty_value(boost::empty_init_t)
|
||||
: T() { }
|
||||
: base() { }
|
||||
|
||||
#if !defined(BOOST_NO_CXX11_RVALUE_REFERENCES)
|
||||
#if !defined(BOOST_NO_CXX11_VARIADIC_TEMPLATES)
|
||||
template<class U, class... Args>
|
||||
BOOST_CONSTEXPR empty_value(boost::empty_init_t, U&& value, Args&&... args)
|
||||
: T(std::forward<U>(value), std::forward<Args>(args)...) { }
|
||||
: base(std::forward<U>(value), std::forward<Args>(args)...) { }
|
||||
#else
|
||||
template<class U>
|
||||
BOOST_CONSTEXPR empty_value(boost::empty_init_t, U&& value)
|
||||
: T(std::forward<U>(value)) { }
|
||||
: base(std::forward<U>(value)) { }
|
||||
#endif
|
||||
#else
|
||||
template<class U>
|
||||
BOOST_CONSTEXPR empty_value(boost::empty_init_t, const U& value)
|
||||
: T(value) { }
|
||||
: base(value) { }
|
||||
|
||||
template<class U>
|
||||
BOOST_CONSTEXPR empty_value(boost::empty_init_t, U& value)
|
||||
: T(value) { }
|
||||
: base(value) { }
|
||||
#endif
|
||||
|
||||
BOOST_CONSTEXPR const T& get() const BOOST_NOEXCEPT {
|
||||
|
Loading…
x
Reference in New Issue
Block a user