mirror of
https://github.com/bolero-MURAKAMI/Sprout.git
synced 2024-12-23 21:25:49 +00:00
[testspr] add print_ln variadic version
This commit is contained in:
parent
22be7201bb
commit
d8cb7a7887
2 changed files with 11 additions and 2 deletions
|
@ -2,6 +2,7 @@
|
|||
#define SPROUT_STRING_TO_STRING_HPP
|
||||
|
||||
#include <sprout/config.hpp>
|
||||
#include <sprout/string/string.hpp>
|
||||
#include <sprout/string/int_to_string.hpp>
|
||||
#include <sprout/string/float_to_string.hpp>
|
||||
|
||||
|
|
|
@ -25,16 +25,24 @@ namespace testspr {
|
|||
//
|
||||
// print_ln
|
||||
//
|
||||
void print_ln() {
|
||||
std::cout << std::endl;
|
||||
}
|
||||
template<typename T>
|
||||
static void print_ln(T const& t) {
|
||||
void print_ln(T const& t) {
|
||||
std::cout << t << std::endl;
|
||||
}
|
||||
template<typename Head, typename... Tail>
|
||||
void print_ln(Head const& head, Tail const&... tail) {
|
||||
std::cout << head;
|
||||
testspr::print_ln(tail...);
|
||||
}
|
||||
|
||||
//
|
||||
// print_bits
|
||||
//
|
||||
template<typename T>
|
||||
static void print_bits(T const& t) {
|
||||
void print_bits(T const& t) {
|
||||
testspr::print_ln(std::bitset<sizeof(T) * 8>(t).template to_string<char>());
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue