Re: No use of initializer list
From: Prateek R Karandikar (kprateek88_at_yahoo.com)
Date: 06/29/04
- Next message: Anand Hariharan: "Re: Why does vector.end() point beyond last element?"
- Previous message: SaltPeter: "Re: ofstream and rdstate()"
- In reply to: Busin: "No use of initializer list"
- Next in thread: Mike Wahler: "Re: No use of initializer list"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Date: 29 Jun 2004 12:51:46 -0700
The FAQ advices you to put one of { [C], [C++], [C,C++] } in the
subject line.
"Busin" <businm@fidrep.com> wrote in message news:<nU8Ec.158042$Gx4.55711@bgtnsc04-news.ops.worldnet.att.net>...
> Class A has a constructor,
>
> A::A(x, y)
What do you mean by this line?
> {
> f(x, y)
> }
The only valid interpretation I can think of here is that f is a macro
that expands the line f(x,y) into something compileable.
> x and y will not be used as member variables of class A but to invoke a
"will not be used as member variables" : Either A has member variables
named x and y or it doesn't. Be specific. Always post complete
compileable code (unless you are getting a compile error and the point
of the post is to ask how to sort it out, in that case post the
complete code and diagnostic messages.)
> function f(x, y). Is it ok to not use an initializer list for constructor
> of class A in such a case?
We don't know much about the "case", (eg, the class, the purpose of
this constructor, what x and y represent, about f, etc), so we can't
tell you whether or not you need a initializer list. In general, you
don't need the initializer list if you are happy with the defaults.
> Thanks!
Welcome
-- --
Abstraction is selective ignorance.
-Andrew Koenig
-- --
- Next message: Anand Hariharan: "Re: Why does vector.end() point beyond last element?"
- Previous message: SaltPeter: "Re: ofstream and rdstate()"
- In reply to: Busin: "No use of initializer list"
- Next in thread: Mike Wahler: "Re: No use of initializer list"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]