mercredi 25 janvier 2017

Check if a template parameter is some type of chrono::duration

Given

template<class T>
struct TimeData
{
  T duration;
}

How can I write a static_assert to check in compile time if T is some type of std::chrono::duration? Remember std::chrono::duration is a template class.

In other words, how can I check if a type is some instantiation of a template class?

Aucun commentaire:

Enregistrer un commentaire