1 //===----------------------------------------------------------------------===//
3 // The LLVM Compiler Infrastructure
5 // This file is dual licensed under the MIT and the University of Illinois Open
6 // Source Licenses. See LICENSE.TXT for details.
8 //===----------------------------------------------------------------------===//
14 // : public unary_function<T, size_t>
16 // size_t operator()(T val) const;
23 #include <type_traits>
25 #include "min_allocator.h"
30 typedef std::vector<bool> T;
31 typedef std::hash<T> H;
32 static_assert((std::is_same<H::argument_type, T>::value), "" );
33 static_assert((std::is_same<H::result_type, std::size_t>::value), "" );
34 ASSERT_NOEXCEPT(H()(T()));
36 bool ba[] = {true, false, true, true, false};
37 T vb(std::begin(ba), std::end(ba));
41 #if TEST_STD_VER >= 11
43 typedef std::vector<bool, min_allocator<bool>> T;
44 typedef std::hash<T> H;
45 static_assert((std::is_same<H::argument_type, T>::value), "" );
46 static_assert((std::is_same<H::result_type, std::size_t>::value), "" );
47 ASSERT_NOEXCEPT(H()(T()));
48 bool ba[] = {true, false, true, true, false};
49 T vb(std::begin(ba), std::end(ba));