forked from Alepha/Alepha
Start using the stream adaptor.
This commit is contained in:
@ -39,15 +39,14 @@ namespace Alepha::Hydrogen::IOStreams ::detail:: OStreamable_m
|
|||||||
{
|
{
|
||||||
const auto decomposed= Alepha::Reflection::tuplizeAggregate( ostreamable );
|
const auto decomposed= Alepha::Reflection::tuplizeAggregate( ostreamable );
|
||||||
//static_assert( Capability< Agg, exports::OStreamable > );
|
//static_assert( Capability< Agg, exports::OStreamable > );
|
||||||
|
auto delim= adaptStream( StartDelimitedList{ []( std::ostream &os ) { os << fieldDelimiter; } }, os );
|
||||||
|
|
||||||
bool first= true;
|
|
||||||
// TODO: Consider the lens system here... but the basic use case seems to be for
|
// TODO: Consider the lens system here... but the basic use case seems to be for
|
||||||
// aggregates, so we'll go with this simple case for now...
|
// aggregates, so we'll go with this simple case for now...
|
||||||
tuple_for_each( decomposed ) <=[&]( const auto &element )
|
tuple_for_each( decomposed ) <=[&]( const auto &element )
|
||||||
{
|
{
|
||||||
if( not first ) os << fieldDelimiter;
|
os << NextItem << element;
|
||||||
first= false;
|
|
||||||
os << element;
|
|
||||||
};
|
};
|
||||||
|
|
||||||
return os;
|
return os;
|
||||||
@ -58,4 +57,3 @@ namespace Alepha::Hydrogen::IOStreams::inline exports::inline OStreamable_m
|
|||||||
{
|
{
|
||||||
using namespace detail::OStreamable_m::exports;
|
using namespace detail::OStreamable_m::exports;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user