PageRenderTime 39ms CodeModel.GetById 15ms RepoModel.GetById 0ms 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
Possible License(s): LGPL-2.1, Cube, GPL-3.0, 0BSD, GPL-2.0
  1. namespace Space {
  2. struct Klass {
  3. Klass(int i) {}
  4. Klass() {}
  5. };
  6. }
  7. namespace AnotherSpace {
  8. class Another {};
  9. }
  10. namespace Space {
  11. using namespace AnotherSpace;
  12. enum Enu { En1, En2, En3 };
  13. template<typename T> struct NotXYZ {};
  14. template<typename T> class XYZ {
  15. NotXYZ<int> *m_int;
  16. T m_t;
  17. NotXYZ<T> m_notxyz;
  18. public:
  19. operator NotXYZ<int>*() const { return m_int; }
  20. operator XYZ<int>*() const { return 0; }
  21. operator Another() const { Another an; return an; }
  22. void templateT(T i) {}
  23. void templateNotXYZ(NotXYZ<T> i) {}
  24. void templateXYZ(XYZ<T> i) {}
  25. operator T() { return m_t; }
  26. operator NotXYZ<T>() const { return m_notxyz; }
  27. operator XYZ<T>() const { XYZ<T> xyz = XYZ<T>(); return xyz; }
  28. };
  29. }
  30. namespace Space {
  31. // non-templated class using itself in method and operator
  32. class ABC {
  33. public:
  34. void method(ABC a) const {}
  35. void method(Klass k) const {}
  36. operator ABC() const { ABC a; return a; }
  37. operator Klass() const { Klass k; return k; }
  38. };
  39. }