[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
std::vector in the union
From: |
Stephane Routelous |
Subject: |
std::vector in the union |
Date: |
Wed, 24 Jul 2002 11:13:44 -0400 |
Hi,
I'm using yacc to parse a file.
In my case, I would like to include some vectors from stl in the union.
But, I can't because, in a union, you cannot have members with copy
constructors.
So, I tried :
typedef union
{
int iVal;
double fVal;
std::vector<MyObject*> objectsVal;
} YYSTYPE;
it doesn't work.
( with VC++ : error C2621: union '__unnamed' : member 'objectsVal' has copy
constructor )
As woraround, I tried also :
struct MyStruct
{
std::vector<MyObject*> objectsVal;
};
typedef union
{
int iVal;
double fVal;
MyStruct sVal;
} YYSTYPE;
I doesn't work too.
( with VC++ : error C2621: union '__unnamed' : member 'sVal' has copy
constructor )
Do you have any idea how I can achieve that ?
Thanks a lot,
Stephane
<http://www.exotk.org>
- std::vector in the union,
Stephane Routelous <=