#
Affected subclause: [istream.extractors]
Change: Character array extraction only takes array types.

Rationale: Increase safety via preventing buffer overflow at compile time.

Effect on original feature: Valid C++ 2017 code may fail to compile in this revision of C++.
[Example 1: auto p = new char[100]; char q[100]; std::cin >> std::setw(20) >> p; / ill-formed; previously well-formed std::cin >> std::setw(20) >> q; / OK — end example]
Affected subclause: [ostream.inserters.character]
Change: Overload resolution for ostream inserters used with UTF-8 literals.

Rationale: Required for new features.

Effect on original feature: Valid C++ 2017 code that passes UTF-8 literals to basic_ostream<char, ..>​::​operator< or basic_ostream<wchar_t, ..>​::​operator< is now ill-formed.
[Example 2: std::cout << u8"text"; / previously called operator<<(const char*) and printed a string; / now ill-formed std::cout << u8'X'; / previously called operator<<(char) and printed a character; / now ill-formed — end example]
Affected subclause: [ostream.inserters.character]
Change: Overload resolution for ostream inserters used with wchar_t, char16_t, or char32_t types.

Rationale: Removal of surprising behavior.

Effect on original feature: Valid C++ 2017 code that passes wchar_t, char16_t, or char32_t characters or strings to basic_ostream<char, ..>​::​operator< or that passes char16_t or char32_t characters or strings to basic_ostream<wchar_t, ..>​::​operator< is now ill-formed.
[Example 3: std::cout << u"text"; / previously formatted the string as a pointer value; / now ill-formed std::cout << u'X'; / previously formatted the character as an integer value; / now ill-formed — end example]
Affected subclause: [fs.class.path]
Change: Return type of filesystem path format observer member functions.

Rationale: Required for new features.

Effect on original feature: Valid C++ 2017 code that depends on the u8string() and generic_u8string() member functions of std​::​filesystem​::​path returning std​::​string is not valid in this revision of C++.
[Example 4: std::filesystem::path p; std::string s1 = p.u8string(); / ill-formed; previously well-formed std::string s2 = p.generic_u8string(); / ill-formed; previously well-formed — end example]

Follow Lee on X/Twitter - Father, Husband, Serial builder creating AI, crypto, games & web tools. We are friends :) AI Will Come To Life!

Check out: eBank.nz (Art Generator) | Netwrck.com (AI Tools) | Text-Generator.io (AI API) | BitBank.nz (Crypto AI) | ReadingTime (Kids Reading) | RewordGame | BigMultiplayerChess | WebFiddle | How.nz | Helix AI Assistant