Cause a link error if we try to stream the wrong kind of string.

master
Pacman Ghost 8 years ago
parent cc2da58655
commit ff94eda46b
  1. 10
      MouseDll/utils.hpp

@ -16,6 +16,16 @@ inline std::string toUtf8( const std::wstring& str ) { return toUtf8(str.c_str()
extern std::wstring fromUtf8( const char* pStr , int len=-1 ) ;
inline std::wstring fromUtf8( const std::string& str ) { return fromUtf8(str.c_str(),str.length()) ; }
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
// NOTE: These are not implemented and will generate a link error if we accidentally
// try to write a string to the wrong kind of stream.
extern std::ostream& operator<<( std::ostream& , const wchar_t* ) ;
extern std::ostream& operator<<( std::ostream& , const std::wstring& ) ;
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
#define MAKE_STRING( msg ) ( ((std::ostringstream&)((std::ostream&)std::ostringstream() << msg)).str() )
// ---------------------------------------------------------------------

Loading…
Cancel
Save