@@ -241,6 +241,52 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
};
#endif
+ template<typename _Alloc, bool
+ = !__is_empty(_Alloc) && __is_trivial(_Alloc)>
+ struct __alloc_value_initializer;
+
+ template<typename _Alloc>
+ struct __alloc_value_initializer<_Alloc, true> : public _Alloc
+ {
+ // Explicit value initialization.
+ __alloc_value_initializer() _GLIBCXX_USE_NOEXCEPT
+ : _Alloc()
+ { }
+
+ __alloc_value_initializer(const _Alloc& __other)
+ _GLIBCXX_NOEXCEPT_IF( noexcept(_Alloc(__other)) )
+ : _Alloc(__other)
+ { }
+
+#if __cplusplus >= 201103L
+ __alloc_value_initializer(_Alloc&& __other)
+ noexcept( noexcept(_Alloc(std::move(__other))) )
+ : _Alloc(std::move(__other))
+ { }
+#endif
+ };
+
+ template<typename _Alloc>
+ struct __alloc_value_initializer<_Alloc, false> : public _Alloc
+ {
+#if __cplusplus >= 201103L
+ __alloc_value_initializer() = default;
+
+ __alloc_value_initializer(_Alloc&& __other)
+ noexcept( noexcept(_Alloc(std::move(__other))) )
+ : _Alloc(std::move(__other))
+ { }
+#else
+ __alloc_value_initializer() throw()
+ { }
+#endif
+
+ __alloc_value_initializer(const _Alloc& __other)
+ _GLIBCXX_NOEXCEPT_IF(noexcept(_Alloc(__other)))
+ : _Alloc(__other)
+ { }
+ };
+
_GLIBCXX_END_NAMESPACE_VERSION
} // namespace std