PageRenderTime 6ms CodeModel.GetById 1ms app.highlight 3ms RepoModel.GetById 1ms app.codeStats 0ms

/trunk/Examples/test-suite/rename.h

#
C++ Header | 44 lines | 38 code | 5 blank | 1 comment | 0 complexity | fcbdd4818a37de806298e46222a83cb2 MD5 | raw file
 1
 2namespace Space {
 3struct Klass {
 4  Klass(int i) {}
 5  Klass() {}
 6};
 7}
 8
 9namespace AnotherSpace {
10  class Another {};
11}
12
13namespace Space {
14  using namespace AnotherSpace;
15  enum Enu { En1, En2, En3 };
16  template<typename T> struct NotXYZ {};
17  template<typename T> class XYZ {
18    NotXYZ<int> *m_int;
19    T m_t;
20    NotXYZ<T> m_notxyz;
21  public:
22    operator NotXYZ<int>*() const { return m_int; }
23    operator XYZ<int>*() const { return 0; }
24    operator Another() const { Another an; return an; }
25    void templateT(T i) {}
26    void templateNotXYZ(NotXYZ<T> i) {}
27    void templateXYZ(XYZ<T> i) {}
28    operator T() { return m_t; }
29    operator NotXYZ<T>() const { return m_notxyz; }
30    operator XYZ<T>() const { XYZ<T> xyz = XYZ<T>(); return xyz; }
31  };
32}
33
34namespace Space {
35// non-templated class using itself in method and operator
36class ABC {
37  public:
38    void method(ABC a) const {}
39    void method(Klass k) const {}
40    operator ABC() const { ABC a; return a; }
41    operator Klass() const { Klass k; return k; }
42};
43}
44