fork download
  1. #include <iostream>
  2.  
  3. // simulate #include <foo.h>
  4. // foo.h begin
  5. struct Foo {
  6. typedef int foo;
  7. };
  8. // foo.h end
  9.  
  10. template<typename T>
  11. void Bar(T*, typename T::foo = 0) {
  12. std::cout << __PRETTY_FUNCTION__ << std::endl;
  13. }
  14.  
  15. void Bar(void*) {
  16. std::cout << __PRETTY_FUNCTION__ << std::endl;
  17. }
  18.  
  19. int main() {
  20. Bar((Foo*)NULL);
  21. }
  22.  
Success #stdin #stdout 0.01s 2724KB
stdin
Standard input is empty
stdout
void Bar(T*, typename T::foo) [with T = Foo]