[lug] Can't create union with classes that have copy CTOR's?

D. Stimits stimits at idcomm.com
Fri Mar 22 13:30:33 MST 2002


LittleViggy at alum.manhattan.edu wrote:
> 
> Hey all,
> 
> I'm trying to create a union of 5 classes.  All five have copy constructors,
> and the compiler is erroring out.  Albeit, I'm using Microsoft (sorry), but
> there's nothing in their documentation that says this is specific to M$.
> 
> Is this ANSI complient?  You can't create a union of classes with copy CTOR's?
> If so, why not?

Don't know why since it has been a long time since I saw this, but
you'll find no executable code can be in a union. I don't remember the
exact explanation, but I do recall I got it from the Stroustrup book,
third edition.

D. Stimits, stimits at idcomm.com

> 
> Viggy
> 
> -------------------------------------------------------------
>      This message was sent from Peak to Peak Internet.
>  DSL - V.90 modems - Web Hosting and Business connectivity
>           Please visit!  http://www.peakpeak.com
>                     (888)-600-PEAK
> -------------------------------------------------------------
> 
> _______________________________________________
> Web Page:  http://lug.boulder.co.us
> Mailing List: http://lists.lug.boulder.co.us/mailman/listinfo/lug



More information about the LUG mailing list