I just wanted to know if there is any news on this topic. In my
opinion, cv-qualified constructors would be a nice feature (which has
no real workaround). I was hoping for the C++0x standard, but I am
very disappointed that I havn't found this issue browsing through the
draft. Have I overlooked something? Is this issue still in discussion?
Maybe an insider (standardization process) could comment on my
question.
Thank you very much!
Mekiro
--
[ See http://www.gotw.ca/resources/clcm.htm for info about ]
[ comp.lang.c++.moderated. First time posters: Do this! ]
What do you mean by a cv-qualified constructor.
Do you mean something like:
struct A {
A() const { }
};
Why do you think something like this is necessary?
comp.std.c++ may be a better group for this.
Also it is not clear from the subject of your message what you are
talking about.
I have personally never heard of this issue, and don't even see how it
is an issue. An object can only become const after it has been created.
I have, but I suspect that I know a rather wider range of programming
languages. What he may mean is the ability to create an immutable
object, which is a common requirement, but I don't know exactly why
and how he finds the current language restrictive. An example might
clarify the issue.
I am not sure that I would start from C++ if I were going there,
because the underlying C model doesn't allow a program to take full
advantage of the concept, but that's another issue.
Regards,
Nick Maclaren.
I agree.
> Also it is not clear from the subject of your message what you are
> talking about.
>
Presumably the OP is talking of something similar to -
MyClass MyObj; // calls default constructor
MyClass const MyObj; // calls a different "special" constructor
> I have personally never heard of this issue, and don't even see how it
> is an issue. An object can only become const after it has been created.
>
I think something to this effect was discussed around the same time
initializer lists were expanded and sequence constructors were
introduced into the language.
The biggest beneficiary of this enhancement was the vector, and it
raised the question whether an implementation could decide if a vector
qualified as const whose size is known at compile time could have
automatic rather than free store memory.
- Anand