On 10/27/10 10:13 PM, Andrea Crotti wrote:
> Now, suppose that in
>
> --8<---------------cut here---------------start------------->8---
> class X
> private:
> ostream& out;
> Other obj;
> --8<---------------cut here---------------end--------------->8---
>
> But object has a constructor that takes "out" as a parameter, which in
> this step is of course not initialized.
>
> How can I solve it? With a pointer maybe (also a reference would have
> the same problem)?
>
> Or maybe this should not happen in general?
Your questions doesn't make a lot of sense, why don't you post real code?
If a reference member must be initialised in constructors.
--
Ian Collins
|