by SloopJon · 2y ago · 0 comments
quantity q1 = 42 * J;
where quantity is a class template: template<Reference auto R,
RepresentationOf<get_quantity_spec(R).character> Rep = double>
class quantity;
I didn't know you could use auto in a template parameter. I gather that Reference is a concept, something else I've yet to explore. Just when I thought I'd gotten the hang of "modern" C++.Being able to use "auto" for the type of the NTTP was new in C++17; and using class types like std::array for NTTPs was only added in C++20.