1 //===----------------------------------------------------------------------===// 2 // 3 // The LLVM Compiler Infrastructure 4 // 5 // This file is dual licensed under the MIT and the University of Illinois Open 6 // Source Licenses. See LICENSE.TXT for details. 7 // 8 //===----------------------------------------------------------------------===// 9 10 // <string> 11 12 // iterator begin(); 13 // iterator end(); 14 // const_iterator begin() const; 15 // const_iterator end() const; 16 // const_iterator cbegin() const; 17 // const_iterator cend() const; 18 19 #include <string> 20 #include <cassert> 21 main()22int main() 23 { 24 #if _LIBCPP_STD_VER > 11 25 { // N3644 testing 26 typedef std::string C; 27 C::iterator ii1{}, ii2{}; 28 C::iterator ii4 = ii1; 29 C::const_iterator cii{}; 30 assert ( ii1 == ii2 ); 31 assert ( ii1 == ii4 ); 32 assert ( ii1 == cii ); 33 assert ( !(ii1 != ii2 )); 34 assert ( !(ii1 != cii )); 35 } 36 37 { // N3644 testing 38 typedef std::wstring C; 39 C::iterator ii1{}, ii2{}; 40 C::iterator ii4 = ii1; 41 C::const_iterator cii{}; 42 assert ( ii1 == ii2 ); 43 assert ( ii1 == ii4 ); 44 assert ( ii1 == cii ); 45 assert ( !(ii1 != ii2 )); 46 assert ( !(ii1 != cii )); 47 } 48 49 { // N3644 testing 50 typedef std::u16string C; 51 C::iterator ii1{}, ii2{}; 52 C::iterator ii4 = ii1; 53 C::const_iterator cii{}; 54 assert ( ii1 == ii2 ); 55 assert ( ii1 == ii4 ); 56 assert ( ii1 == cii ); 57 assert ( !(ii1 != ii2 )); 58 assert ( !(ii1 != cii )); 59 } 60 61 { // N3644 testing 62 typedef std::u32string C; 63 C::iterator ii1{}, ii2{}; 64 C::iterator ii4 = ii1; 65 C::const_iterator cii{}; 66 assert ( ii1 == ii2 ); 67 assert ( ii1 == ii4 ); 68 assert ( ii1 == cii ); 69 assert ( !(ii1 != ii2 )); 70 assert ( !(ii1 != cii )); 71 } 72 #endif 73 } 74