|
From: | Hans Aberg |
Subject: | Re: %union with STL |
Date: | Sun, 24 May 2009 17:55:34 +0200 |
On 24 May 2009, at 16:13, Luca wrote:
I think you're wrong. The size of a pointer is always known at compile time, pair<const string,int>* it; is a pointer and not an object. The size is 4 bytes using a 32 bit OS.C++ dont allow unions containing c++ classes
The problem is what the C++ standard really defines. I recall 'union's can only contains POD (plain old data), which is defined as types built from the C subset. The new C++ will extend this definition.
But you can use void* and cast to this type. The Bison type-system does not work with proper C++ casting involving function calls anyway.
Hans
[Prev in Thread] | Current Thread | [Next in Thread] |