shellux wrote:[color=blue][color=green]
> >You can default-initialize it (perhaps with C++2003 that is
> >value-initialize, but it's the same thing for this problem) with[/color]
>[color=green]
> > A():m_b() {}[/color]
>
>[color=green]
> >Otherwise you'll have to call a function that does the initialization,
> >or do it directly in the constructor body.[/color]
>
>
> I have test a similar class as follow(in VC6.0) , but, as the
> consequence, linker offer an error.
> class Te {
> public:
> Te() : m_int() {
> }
>
> private:
> const int m_int[10];
> };
>
> Linker:d:\program_production\c++\visual_c++\practi ce\commutytry\communitytry.cpp(3)
> : error C2439: 'm_int' : member could not be initialized
>
> d:\program_production\c++\visual_c++\practice\comm utytry\communitytry.cpp(7)
> : see declaration of 'm_int'[/color]
As the OP noted, you could do something like this if you use
std::vector:
http://groups.google.com/group/comp....75a9bd905b06c0
Cheers! --M