Topic: constexpr data member, retry


Author: Zhihao Yuan <lichray@gmail.com>
Date: Wed, 19 Jun 2013 20:20:21 -0400
Raw View
Hi,

I reformed my idea: since it's per-class, and don't need
to be declared static to work, and I only need it to be
accessible within the class scope, how about:

  A non-static constexpr data member has _no linkage_.

Local class also has no linkage, OK to have such a member
(but less useful);

It's not inherit, so I think it's OK to disable A::name;

The potential class scope covers member function
definitions, nested class definitions, etc., OK;

Friend class / functions are accidentally excluded, not too
bad, you can use static constexpr instead.

Other aspects are similar to static data members.

Thoughts?

--
Zhihao Yuan, ID lichray
The best way to predict the future is to invent it.
___________________________________________________
4BSD -- http://4bsd.biz/

--

---
You received this message because you are subscribed to the Google Groups "ISO C++ Standard - Future Proposals" group.
To unsubscribe from this group and stop receiving emails from it, send an email to std-proposals+unsubscribe@isocpp.org.
To post to this group, send email to std-proposals@isocpp.org.
Visit this group at http://groups.google.com/a/isocpp.org/group/std-proposals/.



.


Author: Richard Smith <richard@metafoo.co.uk>
Date: Wed, 19 Jun 2013 17:43:37 -0700
Raw View
On Wed, Jun 19, 2013 at 5:20 PM, Zhihao Yuan <lichray@gmail.com> wrote:
> Hi,
>
> I reformed my idea: since it's per-class, and don't need
> to be declared static to work, and I only need it to be
> accessible within the class scope, how about:
>
>   A non-static constexpr data member has _no linkage_.
>
> Local class also has no linkage, OK to have such a member
> (but less useful);
>
> It's not inherit, so I think it's OK to disable A::name;
>
> The potential class scope covers member function
> definitions, nested class definitions, etc., OK;
>
> Friend class / functions are accidentally excluded, not too
> bad, you can use static constexpr instead.
>
> Other aspects are similar to static data members.
>
> Thoughts?

You need to present a compelling reason for a change to the language.
So far I have not seen one. Based on the previous thread, the
consensus in this community seems to be that avoiding typing "static"
is not considered compelling. (Of course, the full committee may feel
differently, and you are naturally welcome to write a paper.)

--

---
You received this message because you are subscribed to the Google Groups "ISO C++ Standard - Future Proposals" group.
To unsubscribe from this group and stop receiving emails from it, send an email to std-proposals+unsubscribe@isocpp.org.
To post to this group, send email to std-proposals@isocpp.org.
Visit this group at http://groups.google.com/a/isocpp.org/group/std-proposals/.



.