mirror of
https://github.com/matrix-construct/construct
synced 2024-11-29 10:12:39 +01:00
ircd:Ⓜ️🆔 Use generate template; optimize printer.
This commit is contained in:
parent
b698f80067
commit
8bfdd7884b
1 changed files with 28 additions and 6 deletions
34
matrix/id.cc
34
matrix/id.cc
|
@ -370,12 +370,23 @@ const
|
|||
};
|
||||
}};
|
||||
|
||||
const auto gg
|
||||
mutable_buffer buf
|
||||
{
|
||||
maxwidth(size_t(stop - out))[std::forward<decltype(g)>(g)] | eps[throws]
|
||||
out, stop
|
||||
};
|
||||
|
||||
return karma::generate(out, gg, std::forward<decltype(a)>(a));
|
||||
const auto gg
|
||||
{
|
||||
std::forward<decltype(g)>(g) | eps[throws]
|
||||
};
|
||||
|
||||
const auto ret
|
||||
{
|
||||
generate(buf, gg, std::forward<decltype(a)>(a))
|
||||
};
|
||||
|
||||
out = buffer::data(buf);
|
||||
return ret;
|
||||
}
|
||||
|
||||
template<class gen>
|
||||
|
@ -395,12 +406,23 @@ const
|
|||
};
|
||||
}};
|
||||
|
||||
const auto gg
|
||||
mutable_buffer buf
|
||||
{
|
||||
maxwidth(size_t(stop - out))[std::forward<decltype(g)>(g)] | eps[throws]
|
||||
out, stop
|
||||
};
|
||||
|
||||
return karma::generate(out, gg);
|
||||
const auto gg
|
||||
{
|
||||
std::forward<decltype(g)>(g) | eps[throws]
|
||||
};
|
||||
|
||||
const auto ret
|
||||
{
|
||||
generate(buf, gg)
|
||||
};
|
||||
|
||||
out = buffer::data(buf);
|
||||
return ret;
|
||||
}
|
||||
|
||||
template<class... args>
|
||||
|
|
Loading…
Reference in a new issue