rutz::is_polymorphic_imp1< T > Struct Template Reference

Helper struct for telling whether T is a polymorphic type or not. More...

#include <rutz/traits.h>

List of all members.

Public Types

enum  { value = (sizeof(d2) == sizeof(d1)) }
typedef T ncvT

Classes

struct  d1
struct  d2


Detailed Description

template<class T>
struct rutz::is_polymorphic_imp1< T >

Helper struct for telling whether T is a polymorphic type or not.

The implementation trick here is that, if T is NOT polymorphic, then if we derive a new type from T that has virtual functions, then its sizeof() should increase to make room for the vtable pointer. On the other hand, if T is already polymorphic, then it already has a vtable ptr and so adding a new virtual function won't change sizeof() the derived type.

Definition at line 135 of file traits.h.


The documentation for this struct was generated from the following file:

The software described here is Copyright (c) 1998-2005, Rob Peters.
This page was generated Wed Dec 3 06:56:46 2008 by Doxygen version 1.5.5.