allocator_types.pass.cpp [plain text]
#include <memory>
#include <type_traits>
#include <cstddef>
int main()
{
static_assert((std::is_same<std::allocator<char>::size_type, std::size_t>::value), "");
static_assert((std::is_same<std::allocator<char>::difference_type, std::ptrdiff_t>::value), "");
static_assert((std::is_same<std::allocator<char>::pointer, char*>::value), "");
static_assert((std::is_same<std::allocator<char>::const_pointer, const char*>::value), "");
static_assert((std::is_same<std::allocator<char>::value_type, char>::value), "");
static_assert((std::is_same<std::allocator<char>::reference, char&>::value), "");
static_assert((std::is_same<std::allocator<char>::const_reference, const char&>::value), "");
static_assert((std::is_same<std::allocator<char>::rebind<int>::other,
std::allocator<int> >::value), "");
std::allocator<char> a;
std::allocator<char> a2 = a;
a2 = a;
std::allocator<int> a3 = a2;
}