
From: Caleb Epstein <caleb.epstein@gmail.com>
On Fri, 11 Feb 2005 17:55:26 -0500, christopher diggins <cdiggins@videotron.ca> 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@sig.com Software Engineer http://www.sig.com Susquehanna International Group, LLP using std::disclaimer;