mardi 29 août 2017

std::is_base_of and virtual base class

Is there a way to identify whether or not a base class is a virtual base class?

std::is_base_of will identify a base class, but I'm looking for something like std::is_virtual_base_of to identify a virtual base class.

This is for SFINAE purposes where I want to use dynamic_cast (less performant) when std::is_virtual_base_of is true, and static_cast (more performant) when it is false.

Aucun commentaire:

Enregistrer un commentaire