I have the following code:
struct Foo
{
int type;
union
{
int intValue;
double doubleValue;
std::wstring stringValue;
} value;
};
and then in the cpp file I have:
std::vector<Foo> row;
some_class_object->func( row );
and I got:
error C2280: 'void *Foo::__delDtor(unsigned int)': attempting to reference a deleted function
What is the problem here?
EDIT:
So I added this destructor:
~Foo()
{
if( type ==3 )
value.stringValue.~std::wstring();
}
and I got an error:
error C2061: syntax error: identifier 'wstring'.
Apparently std::string vs std::wstring matter in this case...
Didn't know about that.
EDIT2:
I am now getting:
error C2280: 'Foo::<unnamed-type-value>::~<unnamed-type-value>(void)': attempting to reference a deleted function