|
Boost : |
From: Rob Stewart (stewart_at_[hidden])
Date: 2005-02-14 16:16:44
From: Caleb Epstein <caleb.epstein_at_[hidden]>
> On Fri, 11 Feb 2005 17:55:26 -0500, christopher diggins
> <cdiggins_at_[hidden]> wrote:
>
> > > * The basic_profiler ctor initializes members in a different order
> > > than they are declared in the class
> >
> > Does that matter?
>
> Not really, but gcc -Wall warns about it. Its worth fixing if only for that.
It matters in several ways. First, if the initialization of one
data member relies upon the state of another, the latter must be
declared first such that it will be initialized first. The order
of the initializer list doesn't matter; they are initialized in
declaration order. However, keeping them in the same order in
the initialization as they are declared helps to reveal any
problems with initialization order, should that become an issue.
Second, many folks turn on all warnings and even make warnings be
errors to force that there be no warnings in their code. Thus,
warnings such as gcc produces on this matter can be an error for
some.
-- Rob Stewart stewart_at_[hidden] Software Engineer http://www.sig.com Susquehanna International Group, LLP using std::disclaimer;
Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk