Howard Hinnant | bc8d3f9 | 2010-05-11 19:42:16 +0000 | [diff] [blame] | 1 | //===----------------------------------------------------------------------===// |
| 2 | // |
Howard Hinnant | f5256e1 | 2010-05-11 21:36:01 +0000 | [diff] [blame^] | 3 | // The LLVM Compiler Infrastructure |
Howard Hinnant | bc8d3f9 | 2010-05-11 19:42:16 +0000 | [diff] [blame] | 4 | // |
| 5 | // This file is distributed under the University of Illinois Open Source |
| 6 | // License. See LICENSE.TXT for details. |
| 7 | // |
| 8 | //===----------------------------------------------------------------------===// |
| 9 | |
| 10 | // <string> |
| 11 | |
| 12 | // template<class charT, class traits, class Allocator> |
| 13 | // bool operator!=(const charT* lhs, const basic_string<charT,traits,Allocator>& rhs); |
| 14 | |
| 15 | #include <string> |
| 16 | #include <cassert> |
| 17 | |
| 18 | template <class S> |
| 19 | void |
| 20 | test(const typename S::value_type* lhs, const S& rhs, bool x) |
| 21 | { |
| 22 | assert((lhs != rhs) == x); |
| 23 | } |
| 24 | |
| 25 | typedef std::string S; |
| 26 | |
| 27 | int main() |
| 28 | { |
| 29 | test("", S(""), false); |
| 30 | test("", S("abcde"), true); |
| 31 | test("", S("abcdefghij"), true); |
| 32 | test("", S("abcdefghijklmnopqrst"), true); |
| 33 | test("abcde", S(""), true); |
| 34 | test("abcde", S("abcde"), false); |
| 35 | test("abcde", S("abcdefghij"), true); |
| 36 | test("abcde", S("abcdefghijklmnopqrst"), true); |
| 37 | test("abcdefghij", S(""), true); |
| 38 | test("abcdefghij", S("abcde"), true); |
| 39 | test("abcdefghij", S("abcdefghij"), false); |
| 40 | test("abcdefghij", S("abcdefghijklmnopqrst"), true); |
| 41 | test("abcdefghijklmnopqrst", S(""), true); |
| 42 | test("abcdefghijklmnopqrst", S("abcde"), true); |
| 43 | test("abcdefghijklmnopqrst", S("abcdefghij"), true); |
| 44 | test("abcdefghijklmnopqrst", S("abcdefghijklmnopqrst"), false); |
| 45 | } |