fork(1) download
  1. #include <iostream>
  2. using namespace std;
  3.  
  4. struct H
  5. {
  6. template <class C>
  7. struct Ref
  8. {
  9. friend class H;
  10.  
  11. Ref() : m_ref(0) {}
  12.  
  13. template<typename D>
  14. Ref(Ref<D> const& other) : m_ref(other.m_ref) {}
  15. private:
  16. int m_ref;
  17. };
  18.  
  19. };
  20.  
  21.  
  22.  
  23. int main()
  24. {
  25. H::Ref<int> x;
  26. H::Ref<double> y(x);
  27.  
  28. return 0;
  29. }
  30.  
  31.  
Success #stdin #stdout 0s 3464KB
stdin
Standard input is empty
stdout
Standard output is empty