Skip to content

Conversation

@magreenblatt
Copy link
Collaborator

Replace std::stringstream usage with std::format for string formatting throughout the CEF codebase. This improves code readability and leverages C++20's type-safe, compile-time validated formatting.

Also removes unused includes and replaces stream accumulator patterns with more efficient std::string += operations where appropriate.

…3590)

Replace std::stringstream usage with std::format for string formatting
throughout the CEF codebase. This improves code readability and
leverages C++20's type-safe, compile-time validated formatting.

Also removes unused <sstream> includes and replaces stream accumulator
patterns with more efficient std::string += operations where appropriate.
@magreenblatt
Copy link
Collaborator Author

We'll need to wait on this PR due to tooling support limitations.

GCC doesn't support std::format until GCC13:

cef_binary/distrib/libcef_dll/base/cef_logging.cc:27:10: fatal error: format: No such file or directory

Xcode requires a deployment target >= 13.3 to use std::to_char (a std::format implementation dependency):

Xcode-1600.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX15.0.sdk/usr/include/c++/v1/__format/formatter_floating_point.h:66:30: error: 'to_chars' is unavailable: introduced in macOS 13.3
      66 |   to_chars_result __r = std::to_chars(__first, __last, __value, __fmt);
         | 
...
cef_binary/distrib/libcef_dll/wrapper/cef_xml_object.cc:65:24: note: in instantiation of function template specialization 'std::format<int>' requested here
      65 |                   std::format("Value following child element, line {}",
         |                        ^
Xcode-1600.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX15.0.sdk/usr/include/c++/v1/__charconv/to_chars_floating_point.h:42:1: note: 'to_chars' has been explicitly marked unavailable here
      42 | to_chars(char* __first, char* __last, long double __value, chars_format __fmt);
         | ^

@magreenblatt
Copy link
Collaborator Author

This conversion was performed by Claude Code following the plan in CPP20FORMAT.md

@magreenblatt magreenblatt added the blocked Blocked on some other issue/action label Jan 5, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

blocked Blocked on some other issue/action

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant