#include <pantheios/inserters/i.hpp>
#include <pantheios/pan.hpp>
int n = 10;
pan::log_DEBUG("i=", pan::i(n));
pan::log_DEBUG("i=", pan::i(n, -10));
pan::log_DEBUG("i=", pan::i(n, -10, pan::fmt::hex));
produces the same output (and effectively the same binary) as:
#include <pantheios/inserters/integer.hpp>
#include <pantheios/pan.hpp>
int n = 10;
pan::log_DEBUG("i=", pan::integer(n));
pan::log_DEBUG("i=", pan::integer(n, -10));
pan::log_DEBUG("i=", pan::integer(n, -10, pan::fmt::hex));
#include <pantheios/inserters/xi.hpp>
#include <pantheios/pan.hpp>
int n = 16;
pan::log_DEBUG("i=", pan::xi(n));
pan::log_DEBUG("i=", pan::xi(n, -10));
The (hopefully obvious) advantage to both these new inserter types is that they're more succinct. There are more to come ...
No comments:
Post a Comment