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 //===----------------------------------------------------------------------===//
12 // const_reference at(size_type pos) const;
13 // reference at(size_type pos);
19 #include "min_allocator.h"
21 #include "test_macros.h"
25 test(S s, typename S::size_type pos)
30 assert(s.at(pos) == s[pos]);
31 assert(cs.at(pos) == cs[pos]);
33 #ifndef TEST_HAS_NO_EXCEPTIONS
38 TEST_IGNORE_NODISCARD s.at(pos);
41 catch (std::out_of_range&)
43 assert(pos >= s.size());
47 TEST_IGNORE_NODISCARD cs.at(pos);
50 catch (std::out_of_range&)
52 assert(pos >= s.size());
61 typedef std::string S;
68 #if TEST_STD_VER >= 11
70 typedef std::basic_string<char, std::char_traits<char>, min_allocator<char>> S;