Advertisement
Radfler

::print_to

Apr 10th, 2016
107
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.37 KB | None | 0 0
  1. #include <iostream>
  2. #include <istream>
  3. #include <ostream>
  4. #include <utility>
  5.  
  6. template<typename CharT, typename Traits, typename... Args>
  7. void print_to(std::basic_ostream<CharT, Traits>& stream, Args&&... args) {
  8.     (stream << ... << std::forward<Args>(args));
  9. }
  10.  
  11. template<typename... Args>
  12. void print(Args&&... args) {
  13.     print_to(std::cout, std::forward<Args>(args)...);
  14. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement