RE: [reSIProcate] 'this' : used in base member initializer list
- From: "Derek MacDonald" <derek@xxxxxxxx>
- Date: Mon, 13 Sep 2004 10:07:39 -0700
AFAIK, this is a safe use of the this pointer; the value is being stored,
that's it. I don't think other(smarter) compilers will even complain, but I
haven't checked.
--Derek
> -----Original Message-----
> From: resiprocate-devel-bounces@xxxxxxxxxxxxxxxxxxx [mailto:resiprocate-
> devel-bounces@xxxxxxxxxxxxxxxxxxx] On Behalf Of Alan Hawrylyshen
> Sent: Monday, September 13, 2004 8:32 AM
> To: Scott Godin
> Cc: 'resiprocate-devel@xxxxxxxxxxxxxxxxxxx' resiprocate-devel
> Subject: Re: [reSIProcate] 'this' : used in base member initializer list
>
>
> On Sep 13, 2004, at 11:17, Scott Godin wrote:
>
> > Derek,
> >
> > [snip]
> >
> > 'this' : used in base member initializer list
> >
> > The this pointer is valid only within nonstatic member functions. It
> > cannot be used in the initializer list for a base class.
> >
> > The base-class constructors and class member constructors are called
> > before this constructor. In effect, you've passed a pointer to an
> > unconstructed object to another constructor. If those other
> > constructors access any members or call member functions on this, the
> > result will be undefined. You should using the this pointer until all
> > construction has completed.
> >
> >
>
> Scott;
>
> If we are doing anything other than storing the value of the this
> pointer, then the code as written in non-portable and not language
> compliant -- in other words -- I think it merits looking at what's
> going on and refactoring it.
>
> Alan
>
> a l a n a t j a s o m i d o t c o m
>
> _______________________________________________
> resiprocate-devel mailing list
> resiprocate-devel@xxxxxxxxxxxxxxxxxxx
> https://list.sipfoundry.org/mailman/listinfo/resiprocate-devel