[lnkForumImage]
TotalShareware - Download Free Software

Confronta i prezzi di migliaia di prodotti.
Asp Forum
 Home | Login | Register | Search 


 

Forums >

comp.lang.c++

anonymous ctor?

.rhavin grobert

12/6/2008 12:29:00 AM

in anonymous unions you can overload the operators
(at least, it seems to work with my compiler;-), but ...

union {
//whatever
operator= (...);
} foo;

.... is there a way to overload the ctor?
3 Answers

ebony.soft

12/6/2008 7:49:00 AM

0

On Dec 6, 3:28 am, ".rhavin grobert" <cl...@yahoo.de> wrote:
> in anonymous unions you can overload the operators
> (at least, it seems to work with my compiler;-), but ...
>
> union {
>   //whatever
>   operator= (...);
>
> } foo;
>
> ... is there a way to overload the ctor?

Hi .rhavin
According to C++ standard draft SC22-N-4411, Chapter 9, section 9.5
[class.union] paragraph 2:
An anonymous union shall not have function members.
You can't have an anonymous union with member functions let alone to
overload constructors.

Regards,
Saeed Amrollahi

jason.cipriani@gmail.com

12/6/2008 6:57:00 PM

0

On Dec 5, 7:28 pm, ".rhavin grobert" <cl...@yahoo.de> wrote:
> in anonymous unions you can overload the operators
> (at least, it seems to work with my compiler;-), but ...
>
> union {
>   //whatever
>   operator= (...);
>
> } foo;
>
> ... is there a way to overload the ctor?

You can't have an anonymous union with member functions, even if your
particular compiler lets you do it (it shouldn't).

The simple solution may be to not use an anonymous union.

union FooUnion {
//whatever
FooUnion ();
operator= (...);
} foo;

Jason

mirjam

6/19/2014 7:44:00 PM

0

On Thursday, June 19, 2014 6:30:44 PM UTC+3, Giborah wrote:
> On Wednesday, June 18, 2014 8:58:50 PM UTC-7, mirjam wrote:

OK just wanted to help
mirjam


>
> > On Wednesday, June 18, 2014 11:50:57 PM UTC+3, Giborah wrote:
>
> >
>
> > ??? means BRAINS ,sense
>
> >
>
> > ??? ??? means Common sense
>
> >
>
> > intellect is ????? ] sCHALTAN OR AND intellectual MEANS iSH rUACH
>
> >
>
> > mirjam
>
> >
>
> That's why I said "their definition". I knew it meant "sense".
>
>
>
> G.
>
>
>
> >
>
> >
>
> > Hadassah Magazine runs a monthly feature about Hebrew roots and their many and different derivations from Torah > Today.
>
> >
>
> > >
>
> >
>
> > >
>
> >
>
> > >
>
> >
>
> > > This makes interesting and educational reading for people who know Hebrew well or just a little, as well as for hard-core language freaks like yours truly.
>
> >
>
> > >
>
> >
>
> > >
>
> >
>
> > >
>
> >
>
> > > Current feature is: "Making Sense of It All". Play on words, since the root of the month is ??? "Sechel" = intellect (their definition).
>
> >
>
> > >
>
> >
>
> > >
>
> >
>
> > >
>
> >
>
> > > Tried to find a link, but maybe too soon since June/July issue just came out.
>
> >
>
> > >
>
> >
>
> > >
>
> >
>
> > >
>
> >
>
> > > G.