fork(1) download
  1. #include <iostream>
  2.  
  3. namespace foo
  4. {
  5. void print(int x)
  6. {
  7. std::cout << "int=" << x << std::endl;
  8. }
  9. }
  10.  
  11. namespace bar
  12. {
  13. void print(float y)
  14. {
  15. std::cout << "float=" << y << std::endl;
  16. }
  17. }
  18.  
  19. template<typename T>
  20. void doit(T x)
  21. {
  22. using foo::print;
  23. using bar::print;
  24. print(x);
  25. }
  26.  
  27.  
  28. int main() {
  29. doit(5);
  30. doit(1.0f);
  31. return 0;
  32. }
Success #stdin #stdout 0s 3340KB
stdin
Standard input is empty
stdout
int=5
float=1