fork(1) download
  1. #include <iostream>
  2.  
  3. struct widget
  4. {
  5. struct baz { explicit baz() { std::cout << "constructor\n"; } };
  6. static void baz() { std::cout << "function\n"; }
  7. };
  8.  
  9. template<class B>
  10. void foo() { typename B::baz(); }
  11.  
  12. template<class B>
  13. void bar() { B::baz(); }
  14.  
  15. int main()
  16. {
  17. foo<widget>();
  18. bar<widget>();
  19. }
Success #stdin #stdout 0s 3340KB
stdin
Standard input is empty
stdout
constructor
function