1 //===----------------------------------------------------------------------===//
3 // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4 // See https://llvm.org/LICENSE.txt for license information.
5 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
7 //===----------------------------------------------------------------------===//
9 // UNSUPPORTED: c++03, c++11
15 // const_iterator begin() const;
16 // const_iterator end() const;
17 // const_iterator cbegin() const;
18 // const_iterator cend() const;
23 #include "test_macros.h"
28 typedef std::string C
;
29 C::iterator ii1
{}, ii2
{};
30 C::iterator ii4
= ii1
;
31 C::const_iterator cii
{};
32 assert ( ii1
== ii2
);
33 assert ( ii1
== ii4
);
34 assert ( ii1
== cii
);
35 assert ( !(ii1
!= ii2
));
36 assert ( !(ii1
!= cii
));
40 typedef std::wstring C
;
41 C::iterator ii1
{}, ii2
{};
42 C::iterator ii4
= ii1
;
43 C::const_iterator cii
{};
44 assert ( ii1
== ii2
);
45 assert ( ii1
== ii4
);
46 assert ( ii1
== cii
);
47 assert ( !(ii1
!= ii2
));
48 assert ( !(ii1
!= cii
));
51 #if defined(__cpp_lib_char8_t) && __cpp_lib_char8_t >= 201811L
53 typedef std::u8string C
;
54 C::iterator ii1
{}, ii2
{};
55 C::iterator ii4
= ii1
;
56 C::const_iterator cii
{};
57 assert ( ii1
== ii2
);
58 assert ( ii1
== ii4
);
59 assert ( ii1
== cii
);
60 assert ( !(ii1
!= ii2
));
61 assert ( !(ii1
!= cii
));
66 typedef std::u16string C
;
67 C::iterator ii1
{}, ii2
{};
68 C::iterator ii4
= ii1
;
69 C::const_iterator cii
{};
70 assert ( ii1
== ii2
);
71 assert ( ii1
== ii4
);
72 assert ( ii1
== cii
);
73 assert ( !(ii1
!= ii2
));
74 assert ( !(ii1
!= cii
));
78 typedef std::u32string C
;
79 C::iterator ii1
{}, ii2
{};
80 C::iterator ii4
= ii1
;
81 C::const_iterator cii
{};
82 assert ( ii1
== ii2
);
83 assert ( ii1
== ii4
);
84 assert ( ii1
== cii
);
85 assert ( !(ii1
!= ii2
));
86 assert ( !(ii1
!= cii
));