[Development] Oslo, we have a problem</apollo 13> [char8_t]

Fabian Kosmale fabian.kosmale at qt.io
Sat Jul 6 17:31:56 CEST 2019


Yes,

in hindsight this doesn't scale and it was also totally backwards. The issue is that the char8_t overload introduces ambiguity in the overload set, so instead of adding more overloads we should just remove it unless it really matches. So just add an overload taking a generic T and SFINAE it out as needed by testing for std::is_same_v<T, const char8_t*

As you can see at https://godbolt.org/z/SMEeBC , this handles 0, NULL and nullptr just fine, as well as u8 string literals and normal string literals.

Though, if the compilers are implementing the behaviour correctly, maybe the right course of action is to actually complain to the committee that their change breaks code… 

Fabian

--
Fabian Kosmale
Software Engineer
The Qt Company GmbH
Erich-Thilo-Str. 10
D-12489 Berlin
fabian.kosmale at qt.io
+49 1638686070
http://qt.io

Geschäftsführer: Mika Pälsi,
Juha Varelius, Mika Harjuaho
Sitz der Gesellschaft: Berlin,
Registergericht: Amtsgericht
Charlottenburg, HRB 144331 B
--


More information about the Development mailing list