diff --git a/include/boost/logic/tribool_io.hpp b/include/boost/logic/tribool_io.hpp index 0d7af8c..2696dca 100644 --- a/include/boost/logic/tribool_io.hpp +++ b/include/boost/logic/tribool_io.hpp @@ -45,7 +45,7 @@ template<> inline std::basic_string default_false_name() { return "false"; } -# ifndef BOOST_NO_WCHAR_T +# if !defined(BOOST_NO_CWCHAR) /** * \brief Returns the wide character string L"false". * @@ -76,7 +76,7 @@ template<> inline std::basic_string default_true_name() { return "true"; } -# ifndef BOOST_NO_WCHAR_T +# if !defined(BOOST_NO_CWCHAR) /** * \brief Returns the wide character string L"true". * @@ -104,7 +104,7 @@ template<> inline std::basic_string get_default_indeterminate_name() { return "indeterminate"; } -#ifndef BOOST_NO_WCHAR_T +#if !defined(BOOST_NO_CWCHAR) /// Returns the wide character string L"indeterminate". template<> inline std::basic_string get_default_indeterminate_name() diff --git a/test/tribool_io_test.cpp b/test/tribool_io_test.cpp index 84bce90..c2d5021 100644 --- a/test/tribool_io_test.cpp +++ b/test/tribool_io_test.cpp @@ -20,6 +20,18 @@ int test_main(int, char*[]) tribool x; + #if !defined(BOOST_NO_CWCHAR) && !defined(BOOST_NO_STD_WSTRING) + std::wostringstream wout; + wout << std::boolalpha << tribool(false); + BOOST_CHECK(wout.str() == L"false"); + wout.str(std::wstring()); + wout << std::boolalpha << tribool(true); + BOOST_CHECK(wout.str() == L"true"); + wout.str(std::wstring()); + wout << std::boolalpha << tribool(indeterminate); + BOOST_CHECK(wout.str() == L"indeterminate"); + #endif + // Check tribool output std::ostringstream out;