cpp-utils/include/print.hpp
2022-06-23 17:26:19 +01:00

24 lines
527 B
C++

#pragma once
#include <iostream>
#include <string_view>
#include <utility>
#include "format.hpp"
namespace util {
template <typename... Ts>
inline constexpr auto print(std::string_view fmt, Ts&&... args)
->void{
const auto str = util::format(fmt, std::forward<Ts>(args)...);
std::cout.write(str.c_str(), str.size());
}
template <typename... Ts>
inline constexpr auto println(std::string_view fmt, Ts&&... args)
->void{
print(fmt, std::forward<Ts>(args)...);
std::cout.put('\n');
}
}