1
0
forked from Alepha/Alepha

Stream builder notation for strings.

This should be less boilerplate than repeated `lexical_cast`
or `stringify` calls when building strings.
This commit is contained in:
2023-10-25 04:03:39 -04:00
parent bacaa9fcee
commit c2bc8dae2e
5 changed files with 98 additions and 13 deletions

View File

@ -89,10 +89,11 @@ static_assert( __cplusplus > 2020'00 );
#include <boost/lexical_cast.hpp>
#include <Alepha/Alepha.h>
#include <Alepha/Concepts.h>
#include <Alepha/string_algorithms.h>
#include <Alepha/IOStreams/Stream.h>
#include <Alepha/Utility/evaluation_helpers.h>
namespace Alepha::inline Cavorite ::detail:: program_options
@ -265,7 +266,7 @@ namespace Alepha::inline Cavorite ::detail:: program_options
// variable's value in C++ at runtime.
auto defaultBuilder= [&value]
{
auto text= boost::lexical_cast< std::string >( value );
auto text= IOStreams::stringify( value );
if( text.find_first_of( " \n\t" ) != std::string::npos )
{