diff options
Diffstat (limited to 'libstdc++-v3/include/std/tuple')
-rw-r--r-- | libstdc++-v3/include/std/tuple | 35 |
1 files changed, 32 insertions, 3 deletions
diff --git a/libstdc++-v3/include/std/tuple b/libstdc++-v3/include/std/tuple index 8af01f4756e..e6c32b348be 100644 --- a/libstdc++-v3/include/std/tuple +++ b/libstdc++-v3/include/std/tuple @@ -551,16 +551,31 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION { return __and_<is_default_constructible<_Elements>...>::value; } + static constexpr bool _ImplicitlyDefaultConstructibleTuple() + { + return __and_<__is_implicitly_default_constructible<_Elements>...> + ::value; + } }; public: template<typename _Dummy = void, typename enable_if<_TC2<_Dummy>:: - _DefaultConstructibleTuple(), + _ImplicitlyDefaultConstructibleTuple(), bool>::type = true> constexpr tuple() : _Inherited() { } + template<typename _Dummy = void, + typename enable_if<_TC2<_Dummy>:: + _DefaultConstructibleTuple() + && + !_TC2<_Dummy>:: + _ImplicitlyDefaultConstructibleTuple(), + bool>::type = false> + explicit constexpr tuple() + : _Inherited() { } + // Shortcut for the cases where constructors taking _Elements... // need to be constrained. template<typename _Dummy> using _TCC = @@ -837,13 +852,27 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION template <typename _U1 = _T1, typename _U2 = _T2, typename enable_if<__and_< - is_default_constructible<_U1>, - is_default_constructible<_U2>> + __is_implicitly_default_constructible<_U1>, + __is_implicitly_default_constructible<_U2>> ::value, bool>::type = true> constexpr tuple() : _Inherited() { } + template <typename _U1 = _T1, + typename _U2 = _T2, + typename enable_if< + __and_< + is_default_constructible<_U1>, + is_default_constructible<_U2>, + __not_< + __and_<__is_implicitly_default_constructible<_U1>, + __is_implicitly_default_constructible<_U2>>>> + ::value, bool>::type = false> + + explicit constexpr tuple() + : _Inherited() { } + // Shortcut for the cases where constructors taking _T1, _T2 // need to be constrained. template<typename _Dummy> using _TCC = |