int main()
{
- static_assert((std::is_same<std::forward_list<char>::value_type, char>::value), "");
- static_assert((std::is_same<std::forward_list<char>::allocator_type, std::allocator<char> >::value), "");
- static_assert((std::is_same<std::forward_list<char>::reference, char&>::value), "");
- static_assert((std::is_same<std::forward_list<char>::const_reference, const char&>::value), "");
- static_assert((std::is_same<std::forward_list<char>::pointer, char*>::value), "");
- static_assert((std::is_same<std::forward_list<char>::const_pointer, const char*>::value), "");
- static_assert((std::is_same<std::forward_list<char>::size_type, std::size_t>::value), "");
- static_assert((std::is_same<std::forward_list<char>::difference_type, std::ptrdiff_t>::value), "");
+ {
+ typedef std::forward_list<char> C;
+ static_assert((std::is_same<C::value_type, char>::value), "");
+ static_assert((std::is_same<C::allocator_type, std::allocator<char> >::value), "");
+ static_assert((std::is_same<C::reference, char&>::value), "");
+ static_assert((std::is_same<C::const_reference, const char&>::value), "");
+ static_assert((std::is_same<C::pointer, char*>::value), "");
+ static_assert((std::is_same<C::const_pointer, const char*>::value), "");
+ static_assert((std::is_same<C::size_type, std::size_t>::value), "");
+ static_assert((std::is_same<C::difference_type, std::ptrdiff_t>::value), "");
+ }
#if __cplusplus >= 201103L
- static_assert((std::is_same<std::forward_list<char, min_allocator<char>>::value_type, char>::value), "");
- static_assert((std::is_same<std::forward_list<char, min_allocator<char>>::allocator_type, min_allocator<char> >::value), "");
- static_assert((std::is_same<std::forward_list<char, min_allocator<char>>::reference, char&>::value), "");
- static_assert((std::is_same<std::forward_list<char, min_allocator<char>>::const_reference, const char&>::value), "");
- static_assert((std::is_same<std::forward_list<char, min_allocator<char>>::pointer, min_pointer<char>>::value), "");
- static_assert((std::is_same<std::forward_list<char, min_allocator<char>>::const_pointer, min_pointer<const char>>::value), "");
- static_assert((std::is_same<std::forward_list<char, min_allocator<char>>::size_type, std::size_t>::value), "");
- static_assert((std::is_same<std::forward_list<char, min_allocator<char>>::difference_type, std::ptrdiff_t>::value), "");
+ {
+ typedef std::forward_list<char, min_allocator<char>> C;
+ static_assert((std::is_same<C::value_type, char>::value), "");
+ static_assert((std::is_same<C::allocator_type, min_allocator<char> >::value), "");
+ static_assert((std::is_same<C::reference, char&>::value), "");
+ static_assert((std::is_same<C::const_reference, const char&>::value), "");
+ static_assert((std::is_same<C::pointer, min_pointer<char>>::value), "");
+ static_assert((std::is_same<C::const_pointer, min_pointer<const char>>::value), "");
+// min_allocator doesn't have a size_type, so one gets synthesized
+ static_assert((std::is_same<C::size_type, std::make_unsigned<C::difference_type>::type>::value), "");
+ static_assert((std::is_same<C::difference_type, std::ptrdiff_t>::value), "");
+ }
#endif
}