Add support for std::string_view to wx vararg functions
Allow using wxPrintf() etc with std::string_view arguments when using C++17. This is inefficient but still more convenient than not being able to use string_view at all.
This commit is contained in:
@@ -65,6 +65,11 @@ TEST_CASE("StringPrintf", "[wxString][Printf][vararg]")
|
||||
|
||||
wxGCC_WARNING_RESTORE(write-strings)
|
||||
wxCLANG_WARNING_RESTORE(c++11-compat-deprecated-writable-strings)
|
||||
|
||||
#ifdef __cpp_lib_string_view
|
||||
CHECK( wxString::Format("%s", std::string_view{"foobar", 3}) == "foo" );
|
||||
CHECK( wxString::Format("%s", std::string_view{"bar"}) == "bar" );
|
||||
#endif // __cpp_lib_string_view
|
||||
}
|
||||
|
||||
TEST_CASE("CharPrintf", "[wxString][Printf][vararg]")
|
||||
|
Reference in New Issue
Block a user