jeudi 23 novembre 2017

user-defined literals overloading in

chrono takes user-defined literals to make it more convenient. For each literal, it has two overloading functions.

constexpr chrono::hours operator "" h(unsigned long long);
constexpr chrono::duration<unspecified , ratio<3600,1>> operator "" h(long double);

I'm confused by the second overloading function, i.e. the function with long double as parameter.

Why we need the second overloading? And what is unspecified?

Aucun commentaire:

Enregistrer un commentaire