Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

use if constexpr for always constant test known at compilation time #259

Merged
merged 1 commit into from
Feb 24, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/EbmlUnicodeString.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ void UTFstring::UpdateFromUCS2(std::wstring_view WString)
// representation must actually be compatible with the C++
// library's implementation. Implementations with sizeof(wchar_t)
// == 4 are using UCS4.
if (sizeof(wchar_t) == 2)
if constexpr (sizeof(wchar_t) == 2)
::utf8::utf16to8(WString.begin(), Current, std::back_inserter(UTF8string));
else
::utf8::utf32to8(WString.begin(), Current, std::back_inserter(UTF8string));
Expand Down