Fix some failing tests for the standard containers. The tests were failing in 32-bit mode because they assumed that std::size_type and make_unsigned<ptrdiff_t>::type were always the same type. No change to libc++, just the tests.

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@212538 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Marshall Clow 2014-07-08 15:19:40 +00:00
parent 3a61b30f3a
commit 51349536aa
12 changed files with 135 additions and 111 deletions

View File

@ -37,31 +37,34 @@
int main()
{
{
static_assert((std::is_same<std::map<int, double>::key_type, int>::value), "");
static_assert((std::is_same<std::map<int, double>::mapped_type, double>::value), "");
static_assert((std::is_same<std::map<int, double>::value_type, std::pair<const int, double> >::value), "");
static_assert((std::is_same<std::map<int, double>::key_compare, std::less<int> >::value), "");
static_assert((std::is_same<std::map<int, double>::allocator_type, std::allocator<std::pair<const int, double> > >::value), "");
static_assert((std::is_same<std::map<int, double>::reference, std::pair<const int, double>&>::value), "");
static_assert((std::is_same<std::map<int, double>::const_reference, const std::pair<const int, double>&>::value), "");
static_assert((std::is_same<std::map<int, double>::pointer, std::pair<const int, double>*>::value), "");
static_assert((std::is_same<std::map<int, double>::const_pointer, const std::pair<const int, double>*>::value), "");
static_assert((std::is_same<std::map<int, double>::size_type, std::size_t>::value), "");
static_assert((std::is_same<std::map<int, double>::difference_type, std::ptrdiff_t>::value), "");
typedef std::map<int, double> C;
static_assert((std::is_same<C::key_type, int>::value), "");
static_assert((std::is_same<C::mapped_type, double>::value), "");
static_assert((std::is_same<C::value_type, std::pair<const int, double> >::value), "");
static_assert((std::is_same<C::key_compare, std::less<int> >::value), "");
static_assert((std::is_same<C::allocator_type, std::allocator<std::pair<const int, double> > >::value), "");
static_assert((std::is_same<C::reference, std::pair<const int, double>&>::value), "");
static_assert((std::is_same<C::const_reference, const std::pair<const int, double>&>::value), "");
static_assert((std::is_same<C::pointer, std::pair<const int, double>*>::value), "");
static_assert((std::is_same<C::const_pointer, const std::pair<const int, double>*>::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::map<int, double, std::less<int>, min_allocator<std::pair<const int, double>>>::key_type, int>::value), "");
static_assert((std::is_same<std::map<int, double, std::less<int>, min_allocator<std::pair<const int, double>>>::mapped_type, double>::value), "");
static_assert((std::is_same<std::map<int, double, std::less<int>, min_allocator<std::pair<const int, double>>>::value_type, std::pair<const int, double> >::value), "");
static_assert((std::is_same<std::map<int, double, std::less<int>, min_allocator<std::pair<const int, double>>>::key_compare, std::less<int> >::value), "");
static_assert((std::is_same<std::map<int, double, std::less<int>, min_allocator<std::pair<const int, double>>>::allocator_type, min_allocator<std::pair<const int, double> > >::value), "");
static_assert((std::is_same<std::map<int, double, std::less<int>, min_allocator<std::pair<const int, double>>>::reference, std::pair<const int, double>&>::value), "");
static_assert((std::is_same<std::map<int, double, std::less<int>, min_allocator<std::pair<const int, double>>>::const_reference, const std::pair<const int, double>&>::value), "");
static_assert((std::is_same<std::map<int, double, std::less<int>, min_allocator<std::pair<const int, double>>>::pointer, min_pointer<std::pair<const int, double>>>::value), "");
static_assert((std::is_same<std::map<int, double, std::less<int>, min_allocator<std::pair<const int, double>>>::const_pointer, min_pointer<const std::pair<const int, double>>>::value), "");
static_assert((std::is_same<std::map<int, double, std::less<int>, min_allocator<std::pair<const int, double>>>::size_type, std::size_t>::value), "");
static_assert((std::is_same<std::map<int, double, std::less<int>, min_allocator<std::pair<const int, double>>>::difference_type, std::ptrdiff_t>::value), "");
typedef std::map<int, double, std::less<int>, min_allocator<std::pair<const int, double>>> C;
static_assert((std::is_same<C::key_type, int>::value), "");
static_assert((std::is_same<C::mapped_type, double>::value), "");
static_assert((std::is_same<C::value_type, std::pair<const int, double> >::value), "");
static_assert((std::is_same<C::key_compare, std::less<int> >::value), "");
static_assert((std::is_same<C::allocator_type, min_allocator<std::pair<const int, double> > >::value), "");
static_assert((std::is_same<C::reference, std::pair<const int, double>&>::value), "");
static_assert((std::is_same<C::const_reference, const std::pair<const int, double>&>::value), "");
static_assert((std::is_same<C::pointer, min_pointer<std::pair<const int, double>>>::value), "");
static_assert((std::is_same<C::const_pointer, min_pointer<const std::pair<const int, double>>>::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
}

View File

@ -37,31 +37,34 @@
int main()
{
{
static_assert((std::is_same<std::multimap<int, double>::key_type, int>::value), "");
static_assert((std::is_same<std::multimap<int, double>::mapped_type, double>::value), "");
static_assert((std::is_same<std::multimap<int, double>::value_type, std::pair<const int, double> >::value), "");
static_assert((std::is_same<std::multimap<int, double>::key_compare, std::less<int> >::value), "");
static_assert((std::is_same<std::multimap<int, double>::allocator_type, std::allocator<std::pair<const int, double> > >::value), "");
static_assert((std::is_same<std::multimap<int, double>::reference, std::pair<const int, double>&>::value), "");
static_assert((std::is_same<std::multimap<int, double>::const_reference, const std::pair<const int, double>&>::value), "");
static_assert((std::is_same<std::multimap<int, double>::pointer, std::pair<const int, double>*>::value), "");
static_assert((std::is_same<std::multimap<int, double>::const_pointer, const std::pair<const int, double>*>::value), "");
static_assert((std::is_same<std::multimap<int, double>::size_type, std::size_t>::value), "");
static_assert((std::is_same<std::multimap<int, double>::difference_type, std::ptrdiff_t>::value), "");
typedef std::multimap<int, double> C;
static_assert((std::is_same<C::key_type, int>::value), "");
static_assert((std::is_same<C::mapped_type, double>::value), "");
static_assert((std::is_same<C::value_type, std::pair<const int, double> >::value), "");
static_assert((std::is_same<C::key_compare, std::less<int> >::value), "");
static_assert((std::is_same<C::allocator_type, std::allocator<std::pair<const int, double> > >::value), "");
static_assert((std::is_same<C::reference, std::pair<const int, double>&>::value), "");
static_assert((std::is_same<C::const_reference, const std::pair<const int, double>&>::value), "");
static_assert((std::is_same<C::pointer, std::pair<const int, double>*>::value), "");
static_assert((std::is_same<C::const_pointer, const std::pair<const int, double>*>::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::multimap<int, double, std::less<int>, min_allocator<std::pair<const int, double>>>::key_type, int>::value), "");
static_assert((std::is_same<std::multimap<int, double, std::less<int>, min_allocator<std::pair<const int, double>>>::mapped_type, double>::value), "");
static_assert((std::is_same<std::multimap<int, double, std::less<int>, min_allocator<std::pair<const int, double>>>::value_type, std::pair<const int, double> >::value), "");
static_assert((std::is_same<std::multimap<int, double, std::less<int>, min_allocator<std::pair<const int, double>>>::key_compare, std::less<int> >::value), "");
static_assert((std::is_same<std::multimap<int, double, std::less<int>, min_allocator<std::pair<const int, double>>>::allocator_type, min_allocator<std::pair<const int, double> > >::value), "");
static_assert((std::is_same<std::multimap<int, double, std::less<int>, min_allocator<std::pair<const int, double>>>::reference, std::pair<const int, double>&>::value), "");
static_assert((std::is_same<std::multimap<int, double, std::less<int>, min_allocator<std::pair<const int, double>>>::const_reference, const std::pair<const int, double>&>::value), "");
static_assert((std::is_same<std::multimap<int, double, std::less<int>, min_allocator<std::pair<const int, double>>>::pointer, min_pointer<std::pair<const int, double>>>::value), "");
static_assert((std::is_same<std::multimap<int, double, std::less<int>, min_allocator<std::pair<const int, double>>>::const_pointer, min_pointer<const std::pair<const int, double>>>::value), "");
static_assert((std::is_same<std::multimap<int, double, std::less<int>, min_allocator<std::pair<const int, double>>>::size_type, std::size_t>::value), "");
static_assert((std::is_same<std::multimap<int, double, std::less<int>, min_allocator<std::pair<const int, double>>>::difference_type, std::ptrdiff_t>::value), "");
typedef std::multimap<int, double, std::less<int>, min_allocator<std::pair<const int, double>>> C;
static_assert((std::is_same<C::key_type, int>::value), "");
static_assert((std::is_same<C::mapped_type, double>::value), "");
static_assert((std::is_same<C::value_type, std::pair<const int, double> >::value), "");
static_assert((std::is_same<C::key_compare, std::less<int> >::value), "");
static_assert((std::is_same<C::allocator_type, min_allocator<std::pair<const int, double> > >::value), "");
static_assert((std::is_same<C::reference, std::pair<const int, double>&>::value), "");
static_assert((std::is_same<C::const_reference, const std::pair<const int, double>&>::value), "");
static_assert((std::is_same<C::pointer, min_pointer<std::pair<const int, double>>>::value), "");
static_assert((std::is_same<C::const_pointer, min_pointer<const std::pair<const int, double>>>::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
}

View File

@ -37,31 +37,34 @@
int main()
{
{
static_assert((std::is_same<std::multiset<int>::key_type, int>::value), "");
static_assert((std::is_same<std::multiset<int>::value_type, int>::value), "");
static_assert((std::is_same<std::multiset<int>::key_compare, std::less<int> >::value), "");
static_assert((std::is_same<std::multiset<int>::value_compare, std::less<int> >::value), "");
static_assert((std::is_same<std::multiset<int>::allocator_type, std::allocator<int> >::value), "");
static_assert((std::is_same<std::multiset<int>::reference, int&>::value), "");
static_assert((std::is_same<std::multiset<int>::const_reference, const int&>::value), "");
static_assert((std::is_same<std::multiset<int>::pointer, int*>::value), "");
static_assert((std::is_same<std::multiset<int>::const_pointer, const int*>::value), "");
static_assert((std::is_same<std::multiset<int>::size_type, std::size_t>::value), "");
static_assert((std::is_same<std::multiset<int>::difference_type, std::ptrdiff_t>::value), "");
typedef std::multiset<int> C;
static_assert((std::is_same<C::key_type, int>::value), "");
static_assert((std::is_same<C::value_type, int>::value), "");
static_assert((std::is_same<C::key_compare, std::less<int> >::value), "");
static_assert((std::is_same<C::value_compare, std::less<int> >::value), "");
static_assert((std::is_same<C::allocator_type, std::allocator<int> >::value), "");
static_assert((std::is_same<C::reference, int&>::value), "");
static_assert((std::is_same<C::const_reference, const int&>::value), "");
static_assert((std::is_same<C::pointer, int*>::value), "");
static_assert((std::is_same<C::const_pointer, const int*>::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::multiset<int, std::less<int>, min_allocator<int>>::key_type, int>::value), "");
static_assert((std::is_same<std::multiset<int, std::less<int>, min_allocator<int>>::value_type, int>::value), "");
static_assert((std::is_same<std::multiset<int, std::less<int>, min_allocator<int>>::key_compare, std::less<int> >::value), "");
static_assert((std::is_same<std::multiset<int, std::less<int>, min_allocator<int>>::value_compare, std::less<int> >::value), "");
static_assert((std::is_same<std::multiset<int, std::less<int>, min_allocator<int>>::allocator_type, min_allocator<int>>::value), "");
static_assert((std::is_same<std::multiset<int, std::less<int>, min_allocator<int>>::reference, int&>::value), "");
static_assert((std::is_same<std::multiset<int, std::less<int>, min_allocator<int>>::const_reference, const int&>::value), "");
static_assert((std::is_same<std::multiset<int, std::less<int>, min_allocator<int>>::pointer, min_pointer<int>>::value), "");
static_assert((std::is_same<std::multiset<int, std::less<int>, min_allocator<int>>::const_pointer, min_pointer<const int>>::value), "");
static_assert((std::is_same<std::multiset<int, std::less<int>, min_allocator<int>>::size_type, std::size_t>::value), "");
static_assert((std::is_same<std::multiset<int, std::less<int>, min_allocator<int>>::difference_type, std::ptrdiff_t>::value), "");
typedef std::multiset<int, std::less<int>, min_allocator<int>> C;
static_assert((std::is_same<C::key_type, int>::value), "");
static_assert((std::is_same<C::value_type, int>::value), "");
static_assert((std::is_same<C::key_compare, std::less<int> >::value), "");
static_assert((std::is_same<C::value_compare, std::less<int> >::value), "");
static_assert((std::is_same<C::allocator_type, min_allocator<int>>::value), "");
static_assert((std::is_same<C::reference, int&>::value), "");
static_assert((std::is_same<C::const_reference, const int&>::value), "");
static_assert((std::is_same<C::pointer, min_pointer<int>>::value), "");
static_assert((std::is_same<C::const_pointer, min_pointer<const int>>::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
}

View File

@ -37,31 +37,34 @@
int main()
{
{
static_assert((std::is_same<std::set<int>::key_type, int>::value), "");
static_assert((std::is_same<std::set<int>::value_type, int>::value), "");
static_assert((std::is_same<std::set<int>::key_compare, std::less<int> >::value), "");
static_assert((std::is_same<std::set<int>::value_compare, std::less<int> >::value), "");
static_assert((std::is_same<std::set<int>::allocator_type, std::allocator<int> >::value), "");
static_assert((std::is_same<std::set<int>::reference, int&>::value), "");
static_assert((std::is_same<std::set<int>::const_reference, const int&>::value), "");
static_assert((std::is_same<std::set<int>::pointer, int*>::value), "");
static_assert((std::is_same<std::set<int>::const_pointer, const int*>::value), "");
static_assert((std::is_same<std::set<int>::size_type, std::size_t>::value), "");
static_assert((std::is_same<std::set<int>::difference_type, std::ptrdiff_t>::value), "");
typedef std::set<int> C;
static_assert((std::is_same<C::key_type, int>::value), "");
static_assert((std::is_same<C::value_type, int>::value), "");
static_assert((std::is_same<C::key_compare, std::less<int> >::value), "");
static_assert((std::is_same<C::value_compare, std::less<int> >::value), "");
static_assert((std::is_same<C::allocator_type, std::allocator<int> >::value), "");
static_assert((std::is_same<C::reference, int&>::value), "");
static_assert((std::is_same<C::const_reference, const int&>::value), "");
static_assert((std::is_same<C::pointer, int*>::value), "");
static_assert((std::is_same<C::const_pointer, const int*>::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::set<int, std::less<int>, min_allocator<int>>::key_type, int>::value), "");
static_assert((std::is_same<std::set<int, std::less<int>, min_allocator<int>>::value_type, int>::value), "");
static_assert((std::is_same<std::set<int, std::less<int>, min_allocator<int>>::key_compare, std::less<int> >::value), "");
static_assert((std::is_same<std::set<int, std::less<int>, min_allocator<int>>::value_compare, std::less<int> >::value), "");
static_assert((std::is_same<std::set<int, std::less<int>, min_allocator<int>>::allocator_type, min_allocator<int> >::value), "");
static_assert((std::is_same<std::set<int, std::less<int>, min_allocator<int>>::reference, int&>::value), "");
static_assert((std::is_same<std::set<int, std::less<int>, min_allocator<int>>::const_reference, const int&>::value), "");
static_assert((std::is_same<std::set<int, std::less<int>, min_allocator<int>>::pointer, min_pointer<int>>::value), "");
static_assert((std::is_same<std::set<int, std::less<int>, min_allocator<int>>::const_pointer, min_pointer<const int>>::value), "");
static_assert((std::is_same<std::set<int, std::less<int>, min_allocator<int>>::size_type, std::size_t>::value), "");
static_assert((std::is_same<std::set<int, std::less<int>, min_allocator<int>>::difference_type, std::ptrdiff_t>::value), "");
typedef std::set<int, std::less<int>, min_allocator<int>> C;
static_assert((std::is_same<C::key_type, int>::value), "");
static_assert((std::is_same<C::value_type, int>::value), "");
static_assert((std::is_same<C::key_compare, std::less<int> >::value), "");
static_assert((std::is_same<C::value_compare, std::less<int> >::value), "");
static_assert((std::is_same<C::allocator_type, min_allocator<int> >::value), "");
static_assert((std::is_same<C::reference, int&>::value), "");
static_assert((std::is_same<C::const_reference, const int&>::value), "");
static_assert((std::is_same<C::pointer, min_pointer<int>>::value), "");
static_assert((std::is_same<C::const_pointer, min_pointer<const int>>::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
}

View File

@ -43,7 +43,7 @@ void
test(C& c1, int size)
{
typedef typename C::const_iterator CI;
std::size_t c1_osize = c1.size();
typename C::size_type c1_osize = c1.size();
c1.resize(size);
assert(c1.size() == size);
assert(distance(c1.begin(), c1.end()) == c1.size());

View File

@ -43,7 +43,7 @@ void
test(C& c1, int size, int x)
{
typedef typename C::const_iterator CI;
std::size_t c1_osize = c1.size();
typename C::size_type c1_osize = c1.size();
c1.resize(size, x);
assert(c1.size() == size);
assert(distance(c1.begin(), c1.end()) == c1.size());

View File

@ -82,7 +82,8 @@ int main()
static_assert((std::is_same<C::const_reference, const C::value_type&>::value), "");
static_assert((std::is_same<C::pointer, min_pointer<C::value_type>>::value), "");
static_assert((std::is_same<C::const_pointer, min_pointer<const C::value_type>>::value), "");
static_assert((std::is_same<C::size_type, std::size_t>::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

View File

@ -32,22 +32,29 @@
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
}

View File

@ -64,7 +64,8 @@ int main()
static_assert((std::is_same<C::const_reference, const C::value_type&>::value), "");
static_assert((std::is_same<C::pointer, min_pointer<C::value_type>>::value), "");
static_assert((std::is_same<C::const_pointer, min_pointer<const C::value_type>>::value), "");
static_assert((std::is_same<C::size_type, std::size_t>::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

View File

@ -64,7 +64,8 @@ int main()
static_assert((std::is_same<C::const_reference, const C::value_type&>::value), "");
static_assert((std::is_same<C::pointer, min_pointer<C::value_type>>::value), "");
static_assert((std::is_same<C::const_pointer, min_pointer<const C::value_type>>::value), "");
static_assert((std::is_same<C::size_type, std::size_t>::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

View File

@ -61,7 +61,8 @@ int main()
static_assert((std::is_same<C::const_reference, const C::value_type&>::value), "");
static_assert((std::is_same<C::pointer, min_pointer<C::value_type>>::value), "");
static_assert((std::is_same<C::const_pointer, min_pointer<const C::value_type>>::value), "");
static_assert((std::is_same<C::size_type, std::size_t>::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

View File

@ -61,7 +61,8 @@ int main()
static_assert((std::is_same<C::const_reference, const C::value_type&>::value), "");
static_assert((std::is_same<C::pointer, min_pointer<C::value_type>>::value), "");
static_assert((std::is_same<C::const_pointer, min_pointer<const C::value_type>>::value), "");
static_assert((std::is_same<C::size_type, std::size_t>::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