forked from Alepha/Alepha
Make it possible to use arbitrary code in making delimited lists.
This commit is contained in:
@ -12,11 +12,20 @@ namespace Alepha::Hydrogen ::detail:: delimited_list_m
|
||||
{
|
||||
inline namespace exports {}
|
||||
|
||||
using DelimiterWriter= std::function< void ( std::ostream & ) >;
|
||||
struct DelimitedList_params
|
||||
{
|
||||
const std::string delimiter;
|
||||
DelimiterWriter writer;
|
||||
|
||||
explicit DelimitedList_params( const std::string delimiter ) : delimiter( delimiter ) {}
|
||||
explicit
|
||||
DelimitedList_params( const std::string delimiter )
|
||||
: writer( [delimiter] ( std::ostream &os ) { os << delimiter; } )
|
||||
{}
|
||||
|
||||
explicit
|
||||
DelimitedList_params( DelimiterWriter writer )
|
||||
: writer( writer )
|
||||
{}
|
||||
};
|
||||
|
||||
struct MarkItem_t {};
|
||||
|
Reference in New Issue
Block a user