trac-12244: fix detection of wchar_t availability

This commit is contained in:
James E. King III
2018-10-13 03:08:20 +00:00
parent f890fcdf66
commit b65ddb430a
2 changed files with 15 additions and 3 deletions

View File

@ -45,7 +45,7 @@ template<>
inline std::basic_string<char> default_false_name<char>()
{ 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<char> default_true_name<char>()
{ 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<char> get_default_indeterminate_name<char>()
{ return "indeterminate"; }
#ifndef BOOST_NO_WCHAR_T
#if !defined(BOOST_NO_CWCHAR)
/// Returns the wide character string L"indeterminate".
template<>
inline std::basic_string<wchar_t> get_default_indeterminate_name<wchar_t>()

View File

@ -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;