mercredi 30 mars 2016

C++11: How to determine (virtual) inheritance traits?

More specifically, is it possible in C++11 (or later) to write compile-time type traits for a given type T to determine

  1. whether T is abstract, i.e. has any pure virtual methods?
  2. whether T is a final class?
  3. whether a given member F of T (including T's destructor) can be overridden, i.e. can a subclass S of T declare S::F with override?

Aucun commentaire:

Enregistrer un commentaire