24 lines
527 B
C++
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');
|
|
}
|
|
|
|
} |