diff options
Diffstat (limited to 'libstdc++-v3/include/bits/stl_list.h')
-rw-r--r-- | libstdc++-v3/include/bits/stl_list.h | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/libstdc++-v3/include/bits/stl_list.h b/libstdc++-v3/include/bits/stl_list.h index be5bb5e..8ed97f7 100644 --- a/libstdc++-v3/include/bits/stl_list.h +++ b/libstdc++-v3/include/bits/stl_list.h @@ -571,6 +571,15 @@ _GLIBCXX_BEGIN_NAMESPACE_CXX11 __glibcxx_class_requires2(_Tp, _Alloc_value_type, _SameTypeConcept) #endif +#if __cplusplus >= 201103L + static_assert(is_same<typename remove_cv<_Tp>::type, _Tp>::value, + "std::list must have a non-const, non-volatile value_type"); +# ifdef __STRICT_ANSI__ + static_assert(is_same<typename _Alloc::value_type, _Tp>::value, + "std::list must have the same value_type as its allocator"); +# endif +#endif + typedef _List_base<_Tp, _Alloc> _Base; typedef typename _Base::_Tp_alloc_type _Tp_alloc_type; typedef typename _Base::_Tp_alloc_traits _Tp_alloc_traits; |