Philippe A. Bouchard wrote:
[...]
> void foo(optional<A> const &)
> {
> }
>
> int main()
> {
> optional<B> b;
> optional<C> c;
>
> foo(b);
> //foo(c);
> }
There is a bool (m_initialized) that will prevent the pointer to access
directly the virtual table. It may not be the case if the boolean was
separated from the object, otherwise you will have 2 virtual tables and 1
boolean for one polymorphic object. Forget the type_with_alignment benefits
in this case.
Philippe A. Bouchard
_______________________________________________
Unsubscribe & other changes: http://lists.boost.org/mailman/listinfo.cgi/boost