| 1 | #include "stltypes.h" |
| 2 | |
| 3 | |
| 4 | //- explicit instantiations of used comparisons |
| 5 | #if defined __clang__ |
| 6 | namespace std { |
| 7 | #define ns_prefix std:: |
| 8 | #elif defined(__GNUC__) || defined(__GNUG__) |
| 9 | namespace __gnu_cxx { |
| 10 | #define ns_prefix |
| 11 | #endif |
| 12 | template bool ns_prefix operator==(const std::vector<int>::iterator&, |
| 13 | const std::vector<int>::iterator&); |
| 14 | template bool ns_prefix operator!=(const std::vector<int>::iterator&, |
| 15 | const std::vector<int>::iterator&); |
| 16 | } |
| 17 | |
| 18 | //- class with lots of std::string handling |
| 19 | stringy_class::stringy_class(const char* s) : m_string(s) {} |
| 20 | |
| 21 | std::string stringy_class::get_string1() { return m_string; } |
| 22 | void stringy_class::get_string2(std::string& s) { s = m_string; } |
| 23 | |
| 24 | void stringy_class::set_string1(const std::string& s) { m_string = s; } |
| 25 | void stringy_class::set_string2(std::string s) { m_string = s; } |
| 26 | |
| 27 | |
| 28 | //- helpers for testing array |
| 29 | int ArrayTest::get_pp_px(Point** p, int idx) { |
| 30 | return p[idx]->px; |
| 31 | } |
| 32 | |
| 33 | int ArrayTest::get_pp_py(Point** p, int idx) { |
| 34 | return p[idx]->py; |
| 35 | } |
| 36 | |
| 37 | int ArrayTest::get_pa_px(Point* p[], int idx) { |
| 38 | return p[idx]->px; |
| 39 | } |
| 40 | |
| 41 | int ArrayTest::get_pa_py(Point* p[], int idx) { |
| 42 | return p[idx]->py; |
| 43 | } |
| 44 | |
| 45 | |
| 46 | // helpers for string testing |
| 47 | std::string str_array_1[3] = {"a", "b", "c"}; |
| 48 | std::string str_array_2[] = {"d", "e", "f", "g"}; |
| 49 | std::string str_array_3[3][2] = {{"a", "b"}, {"c", "d"}, {"e", "f"}}; |
| 50 | std::string str_array_4[4][2][2] = { |
| 51 | {{"a", "b"}, {"c", "d"}}, |
| 52 | {{"e", "f"}, {"g", "h"}}, |
| 53 | {{"i", "j"}, {"k", "l"}}, |
| 54 | {{"m", "n"}, {"o", "p"}}, |
| 55 | }; |