diff --git a/include/loki/SafeFormat.h b/include/loki/SafeFormat.h index 5c4919e..6f82d8e 100644 --- a/include/loki/SafeFormat.h +++ b/include/loki/SafeFormat.h @@ -44,6 +44,7 @@ #include #include +#include // long is 32 bit on 64-bit Windows! @@ -132,7 +133,7 @@ namespace Loki another device type. It is not for public use. */ template < class Device2 > - PrintfState< Device2, Char > ChangeDevice( Device2 & device ) const + PrintfState< Device2, Char > ChangeDevice( typename Loki::TypeTraits< Device2 >::ParameterType device ) const { return PrintfState< Device2, Char >( device, format_, width_, prec_, flags_, result_ ); } diff --git a/src/SafeFormat.cpp b/src/SafeFormat.cpp index 865b9a4..c6de343 100644 --- a/src/SafeFormat.cpp +++ b/src/SafeFormat.cpp @@ -70,7 +70,7 @@ namespace Loki const PrintfState< ::std::string &, char > state1( buffer, format ); ::std::fwrite( buffer.c_str(), 1, buffer.size(), stdout ); ::std::FILE * f = stdout; - PrintfState< std::FILE *, char > printState2( state1.ChangeDevice( f ) ); + PrintfState< std::FILE *, char > printState2( state1.ChangeDevice< ::std::FILE * >( f ) ); return printState2; } @@ -79,7 +79,7 @@ namespace Loki const PrintfState< ::std::string &, char > state1( buffer, format.c_str() ); ::std::fwrite( buffer.c_str(), 1, buffer.size(), stdout ); ::std::FILE * f = stdout; - PrintfState< std::FILE *, char > printState2( state1.ChangeDevice( f ) ); + PrintfState< std::FILE *, char > printState2( state1.ChangeDevice< ::std::FILE * >( f ) ); return printState2; } @@ -87,7 +87,7 @@ namespace Loki ::std::string buffer; const PrintfState< ::std::string &, char > state1( buffer, format ); ::std::fwrite( buffer.c_str(), 1, buffer.size(), f ); - PrintfState< std::FILE *, char > printState2 = state1.ChangeDevice( f ); + PrintfState< std::FILE *, char > printState2 = state1.ChangeDevice< ::std::FILE * >( f ); return printState2; } @@ -95,7 +95,7 @@ namespace Loki ::std::string buffer; const PrintfState< ::std::string &, char > state1( buffer, format.c_str() ); ::std::fwrite( buffer.c_str(), 1, buffer.size(), f ); - PrintfState< std::FILE *, char > printState2 = state1.ChangeDevice( f ); + PrintfState< std::FILE *, char > printState2 = state1.ChangeDevice< ::std::FILE * >( f ); return printState2; }