MACRO
OMNI_WOSTREAM_OPERATOR - A helper macro to implement the operator<< wide stream friend function
SYNOPSIS top
This macro can be utilized to implement the
This macro can be utilized to implement the
friend std::wostream& operator<< function in a class.
DESCRIPTION top
This is a helper macro that can allow you to implement the
Example:
This is a helper macro that can allow you to implement the
friend std::wostream& operator<< function within a class to allow to print to a wide output stream.Example:
#include <omnilib> class MyClass { public: MyClass() : m_val(42) {} OMNI_WOSTREAM_OPERATOR(MyClass, m_val) private: int m_val; }; int main(int argc, char* argv[]) { MyClass val; std::wstringstream ss; ss << val; std::wcout << "wstring stream, val = " << ss.str() << std::endl; std::wcout << "wostream operator, val = " << val << std::endl; return 0; }