Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Any news?

2 views
Skip to first unread message

mek...@thankyou2010.com

unread,
Aug 21, 2010, 12:06:44 PM8/21/10
to
Hi @all,

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! ]

red floyd

unread,
Aug 22, 2010, 9:58:37 AM8/22/10
to
On 8/21/2010 9:06 AM, mek...@thankyou2010.com wrote:
> Hi @all,
>
> 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.

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?

Mathias Gaunard

unread,
Aug 22, 2010, 10:00:38 AM8/22/10
to
On Aug 21, 5:06 pm, mek...@thankyou2010.com wrote:
> Hi @all,
>
> 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.

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.

nm...@cam.ac.uk

unread,
Aug 22, 2010, 8:59:56 PM8/22/10
to
In article <02864409-eadf-45de...@l6g2000yqb.googlegroups.com>,

Mathias Gaunard <louf...@gmail.com> wrote:
>On Aug 21, 5:06 pm, mek...@thankyou2010.com wrote:
>>
>> 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.
>
>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.

Anand Hariharan

unread,
Aug 22, 2010, 9:01:59 PM8/22/10
to
On Aug 22, 9:00 am, Mathias Gaunard <loufo...@gmail.com> wrote:
> On Aug 21, 5:06 pm, mek...@thankyou2010.com wrote:
>
> > Hi @all,
>
> > 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.
>
> comp.std.c++ may be a better group for this.

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

0 new messages