fork download
  1. #include <iostream>
  2. #define endl static_cast<std::ostream&(*)(std::ostream&)>(std::endl)
  3. using namespace std;
  4.  
  5. namespace foo {
  6. template <typename T>
  7. void cout (const T& value) {
  8. std::cout<<value;
  9. }
  10.  
  11. template <typename T, typename... R>
  12. void cout (const T& head, const R&... tail) {
  13. std::cout<<head;
  14. cout(tail...);
  15. }
  16. }
  17.  
  18. int main() {
  19. using foo::cout; //przyslaniamy cout z std nasza wlasna funkcja
  20. string a = "niewiemco";
  21. cout(23, endl, 12312, "\n", 12412, endl, a);
  22. return 0;
  23. }
  24.  
Success #stdin #stdout 0s 3228KB
stdin
Standard input is empty
stdout
23
12312
12412
niewiemco