Skip to content

Instantly share code, notes, and snippets.

@StefanoBelli
Created September 10, 2018 19:32
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save StefanoBelli/665880274ecf1195ae81c2648a45307b to your computer and use it in GitHub Desktop.
Save StefanoBelli/665880274ecf1195ae81c2648a45307b to your computer and use it in GitHub Desktop.
#ifndef PRINT_H
#define PRINT_H
#include <iostream>
#include <utility>
template<typename Ty>
void print(Ty&& p) { std::cout << std::forward<Ty>(p); }
template <typename First, typename ...Many>
void print(First&& f, Many&&... a) {
std::cout << std::forward<First>(f);
print(std::forward<Many>(a)...);
}
template<typename Ty>
void println(Ty&& p) { std::cout << std::forward<Ty>(p) << '\n'; }
template <typename First, typename ...Many>
void println(First&& f, Many&&... a) {
print(std::forward<First>(f), std::forward<Many>(a)...);
std::cout << '\n';
}
#endif
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment