C++ Logo

std-discussion

Advanced search

Re: Possible defect in [class.mem]/17

From: Tam S. B. <cpplearner_at_[hidden]>
Date: Fri, 7 Jun 2019 10:55:41 +0000
Non-static member functions are declared with "ordinary" function types (if we can say [Abominable Function Types] are "ordinary"). AFAIK currently the spec explains this by saying that they actually have function types, and it might get slightly more complex if it stops saying so.

Anyway I don't think the types of NSMF have any effect practically.

```
using T = int();

template<class X> struct A { T f; };

template<> T A<int>::f;
```

[Abominable Function Types]: http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2015/p0172r0.html

________________________________________
From: Std-Discussion <std-discussion-bounces_at_lists.isocpp.org> on behalf of Alexander via Std-Discussion <std-discussion_at_lists.isocpp.org>
Sent: Tuesday, June 4, 2019 20:51
To: std-discussion_at_[hidden]socpp.org
Cc: Alexander
Subject: [std-discussion] Possible defect in [class.mem]/17

[class.mem]/17<http://eel.is/c++draft/class.mem#17>:

[ Note<http://eel.is/c++draft/class.mem#17.note-1>
:
The type of a non-static member function is an ordinary function type, and the type of a non-static data member is an ordinary object type.<http://eel.is/c++draft/class.mem#17.sentence-1>
There are no special member function types or data member types.<http://eel.is/c++draft/class.mem#17.sentence-2>
 — end note
 ]

Given this recent answer<https://stackoverflow.com/a/56409927/1042389> in SO, I would say that the first part (in bold) of this Note is a defect. It simply doesn't make any sense to me. I would appreciate some feedback on this.

Received on 2019-06-07 05:57:29