| 1 | #include <stdio.h> |
| 2 | #include <stdint.h> |
| 3 | |
| 4 | namespace a { |
| 5 | class c { |
| 6 | public: |
| 7 | c(); |
| 8 | ~c(); |
| 9 | void func1() |
| 10 | { |
| 11 | puts (s: __PRETTY_FUNCTION__); |
| 12 | } |
| 13 | void func2() |
| 14 | { |
| 15 | puts (s: __PRETTY_FUNCTION__); |
| 16 | } |
| 17 | void func3() |
| 18 | { |
| 19 | puts (s: __PRETTY_FUNCTION__); |
| 20 | } |
| 21 | }; |
| 22 | |
| 23 | c::c() {} |
| 24 | c::~c() {} |
| 25 | } |
| 26 | |
| 27 | namespace aa { |
| 28 | class cc { |
| 29 | public: |
| 30 | cc(); |
| 31 | ~cc(); |
| 32 | void func1() |
| 33 | { |
| 34 | puts (s: __PRETTY_FUNCTION__); |
| 35 | } |
| 36 | void func2() |
| 37 | { |
| 38 | puts (s: __PRETTY_FUNCTION__); |
| 39 | } |
| 40 | void func3() |
| 41 | { |
| 42 | puts (s: __PRETTY_FUNCTION__); |
| 43 | } |
| 44 | }; |
| 45 | |
| 46 | cc::cc() {} |
| 47 | cc::~cc() {} |
| 48 | } |
| 49 | |
| 50 | namespace b { |
| 51 | class c { |
| 52 | public: |
| 53 | c(); |
| 54 | ~c(); |
| 55 | void func1() |
| 56 | { |
| 57 | puts (s: __PRETTY_FUNCTION__); |
| 58 | } |
| 59 | void func3() |
| 60 | { |
| 61 | puts (s: __PRETTY_FUNCTION__); |
| 62 | } |
| 63 | }; |
| 64 | |
| 65 | c::c() {} |
| 66 | c::~c() {} |
| 67 | } |
| 68 | |
| 69 | namespace c { |
| 70 | class d { |
| 71 | public: |
| 72 | d () {} |
| 73 | ~d() {} |
| 74 | void func2() |
| 75 | { |
| 76 | puts (s: __PRETTY_FUNCTION__); |
| 77 | } |
| 78 | void func3() |
| 79 | { |
| 80 | puts (s: __PRETTY_FUNCTION__); |
| 81 | } |
| 82 | }; |
| 83 | } |
| 84 | |
| 85 | namespace ns { |
| 86 | template <typename Type> struct Foo { |
| 87 | template <typename T> void import() {} |
| 88 | |
| 89 | template <typename T> auto func() {} |
| 90 | |
| 91 | operator bool() { return true; } |
| 92 | |
| 93 | template <typename T> operator T() { return {}; } |
| 94 | |
| 95 | template <typename T> void operator<<(T t) {} |
| 96 | }; |
| 97 | |
| 98 | template <typename Type> void g() {} |
| 99 | } // namespace ns |
| 100 | |
| 101 | int main (int argc, char const *argv[]) |
| 102 | { |
| 103 | a::c ac; |
| 104 | aa::cc aac; |
| 105 | b::c bc; |
| 106 | c::d cd; |
| 107 | ac.func1(); |
| 108 | ac.func2(); |
| 109 | ac.func3(); |
| 110 | aac.func1(); |
| 111 | aac.func2(); |
| 112 | aac.func3(); |
| 113 | bc.func1(); |
| 114 | bc.func3(); |
| 115 | cd.func2(); |
| 116 | cd.func3(); |
| 117 | |
| 118 | ns::Foo<double> f; |
| 119 | f.import <int>(); |
| 120 | f.func<int>(); |
| 121 | f.func<ns::Foo<int>>(); |
| 122 | f.operator bool(); |
| 123 | f.operator a::c(); |
| 124 | f.operator ns::Foo<int>(); |
| 125 | f.operator<<(t: 5); |
| 126 | f.operator<< <ns::Foo<int>>(t: {}); |
| 127 | |
| 128 | ns::g<int>(); |
| 129 | ns::g<char>(); |
| 130 | |
| 131 | return 0; |
| 132 | } |
| 133 | |