Boost C++ Libraries

...one of the most highly regarded and expertly designed C++ library projects in the world. Herb Sutter and Andrei Alexandrescu, C++ Coding Standards

Click here to view the latest version of this page.
PrevUpHomeNext

is_virtual_base_of

template <class Base, class Derived>
struct is_virtual_base_of : public true_type-or-false_type {};

Inherits: If Base is a virtual base class of type Derived then inherits from true_type, otherwise inherits from false_type.

Types Base and Derived must not be incomplete types.

C++ Standard Reference: 10.

Header: #include <boost/type_traits/is_virtual_base_of.hpp> or #include <boost/type_traits.hpp>

Compiler Compatibility: this trait also requires a working is_base_of trait.

Examples:

Given: class Base{}; class Derived : public virtual Base{};

is_virtual_base_of<Base, Derived> inherits from true_type.

is_virtual_base_of<Base, Derived>::type is the type true_type.

is_virtual_base_of<Base, Derived>::value is an integral constant expression that evaluates to true.

is_virtual_base_of<Base, Derived>::value is an integral constant expression that evaluates to true.

is_virtual_base_of<T, U>::value_type is the type bool.


PrevUpHomeNext