C++ Logo

sg16

Advanced search

[SG16] SI unities with unicode identifiers according to p1949

From: Cleiton Santoia <cleitonsantoia_at_[hidden]>
Date: Sun, 28 Nov 2021 23:16:33 -0300
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
https://www.godbolt.org/z/eYz31a9cq


BR
Cleiton

Received on 2021-11-28 20:16:47