From 87634c4549506a7ff3717db689573d1b00b94c82 Mon Sep 17 00:00:00 2001 From: ADAM David Alan Martin Date: Tue, 17 Oct 2023 15:31:25 -0400 Subject: [PATCH] `StackableStreambuf` needs to be exported (and cleaned up). --- Utility/StackableStreambuf.h | 18 ++++++++++++++---- 1 file changed, 14 insertions(+), 4 deletions(-) diff --git a/Utility/StackableStreambuf.h b/Utility/StackableStreambuf.h index 81ad6ef..8f7d188 100644 --- a/Utility/StackableStreambuf.h +++ b/Utility/StackableStreambuf.h @@ -4,7 +4,7 @@ static_assert( __cplusplus > 2020'00 ); #include -#include +#include #include #include @@ -36,6 +36,7 @@ namespace Alepha::Hydrogen::Utility ::detail:: stackable_streambuf ~StackableStreambuf() {} + // Children must be created by `new`. explicit StackableStreambuf( std::ostream &host ) : underlying( host.rdbuf( this ) ) @@ -67,7 +68,7 @@ namespace Alepha::Hydrogen::Utility ::detail:: stackable_streambuf } }; - void + inline void impl::releaseStack( std::ios_base &ios ) { auto &os= dynamic_cast< std::ostream & >( ios ); @@ -91,7 +92,11 @@ namespace Alepha::Hydrogen::Utility ::detail:: stackable_streambuf } template< typename T > - struct exports::PushStack : T {}; + struct exports::PushStack + : T + { + using T::T; + }; template< typename T > struct exports::PopStack {}; @@ -100,7 +105,7 @@ namespace Alepha::Hydrogen::Utility ::detail:: stackable_streambuf std::ostream & operator << ( std::ostream &os, PushStack< T > &¶ms ) { - build_streambuf( os, params ); + build_streambuf( os, std::move( params ) ); return os; } @@ -113,3 +118,8 @@ namespace Alepha::Hydrogen::Utility ::detail:: stackable_streambuf } } + +namespace Alepha::Hydrogen::Utility::inline exports::inline stackable_streambuf +{ + using namespace detail::stackable_streambuf::exports; +}