Topic: Let the developer to know number of items in


Author: =?UTF-8?Q?Daniel_Kr=C3=BCgler?= <daniel.kruegler@gmail.com>
Date: Tue, 7 Mar 2017 10:47:51 +0100
Raw View
2017-03-07 10:41 GMT+01:00 Bo Persson <bop@gmb.dk>:
> On 2017-03-06 16:29, Micha=C5=82 Dominiak wrote:
>>
>> That still conflicts with existing enumeration values named `length`.
>
> Not if we allow it as a member function
>
> enum Foobar
> {
>    foo, bar
>
>    static size_t length()
>    { return 2; }
>
> };

Even if we allow adding member functions to enumeration types, this
does not *automatically* mean that these functions can have the same
names as enumerators.

The following very similar example is ill-formed:

struct S {
  enum E { length };
  void length();
};

- Daniel

--=20
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 e=
mail to std-proposals+unsubscribe@isocpp.org.
To post to this group, send email to std-proposals@isocpp.org.
To view this discussion on the web visit https://groups.google.com/a/isocpp=
..org/d/msgid/std-proposals/CAGNvRgDq1wQisjSC7vg0YN2E2ZRVDmhTx1uh_M5uBVyYgJC=
Mgw%40mail.gmail.com.

.