mardi 15 août 2017

Code explanation of the json11 library about implicit constructor

I'm reading the source code of the main json11 header file.

It contains the following declaration:

template <class T, class = decltype(&T::to_json)>
Json(const T & t) : Json(t.to_json()) {}

I'm trying to find some documentation about this usage of decltype and class inside a template declaration but no success.

Does this construction/usage has a name in C++? Any good reference about it?

Aucun commentaire:

Enregistrer un commentaire