Does unicode support allow a portable STL UDL like s² ?
inline fancy_unity_time_square operator "" s²(long double s) {
return fancy_unity_time_square{s * s};
};
auto t2 = 6s²
auto g = 9.8m/s²;
Working sample
No - GCC only conforms to P1949 under c++23 and -pedantic, which i think is a bit unfortunate
https://www.godbolt.org/z/deczGWf8xClang has the correct behavior by default
https://www.godbolt.org/z/63TWrMGbh² doesn't have the XID_Continue continue property and therefore cannot be part of identifiers. UDL suffixes are identifiers as far as the C++ grammar is
concerned, and so they obey the same rules as other identifiers.