fork download
  1. #include <iostream>
  2. using namespace std;
  3.  
  4. template <typename T>
  5. struct foo
  6. {
  7. foo()
  8. {
  9. std::cout << "\nConstructed: " << (void*)(this);
  10. }
  11.  
  12. T m_value;
  13. };
  14.  
  15. struct bar
  16. {
  17. foo<int> m_value;
  18. };
  19.  
  20. int main() {
  21. foo<bar> f;
  22.  
  23. return 0;
  24. }
Success #stdin #stdout 0s 3340KB
stdin
Standard input is empty
stdout
Constructed: 0xbf911b1c
Constructed: 0xbf911b1c