Skip to content

Commit

Permalink
8293595: tstrings::any() is missing an overload
Browse files Browse the repository at this point in the history
Reviewed-by: asemenyuk, almatvee
  • Loading branch information
TheShermanTanker authored and Alexey Semenyuk committed Sep 20, 2022
1 parent 0f28cb0 commit bb422f5
Showing 1 changed file with 11 additions and 6 deletions.
17 changes: 11 additions & 6 deletions src/jdk.jpackage/share/native/common/tstrings.h
Expand Up @@ -356,6 +356,11 @@ namespace tstrings {
data << fromUtf8(msg);
}

any& operator << (const std::string& msg) {
data << fromUtf8(msg);
return *this;
}

#ifdef TSTRINGS_WITH_WCHAR
any(std::wstring::const_pointer msg) {
data << msg;
Expand All @@ -365,22 +370,22 @@ namespace tstrings {
data << msg;
}

any& operator << (const std::wstring& v) {
data << v;
any& operator << (const std::wstring& msg) {
data << msg;
return *this;
}

// need this specialization instead std::wstring::pointer,
// otherwise LPWSTR is handled as abstract pointer (void*)
any& operator << (LPWSTR v) {
data << (v ? v : L"NULL");
any& operator << (LPWSTR msg) {
data << (msg ? msg : L"NULL");
return *this;
}

// need this specialization instead std::wstring::const_pointer,
// otherwise LPCWSTR is handled as abstract pointer (const void*)
any& operator << (LPCWSTR v) {
data << (v ? v : L"NULL");
any& operator << (LPCWSTR msg) {
data << (msg ? msg : L"NULL");
return *this;
}

Expand Down

0 comments on commit bb422f5

Please sign in to comment.