C++ Logo

STD-DISCUSSION

Advanced search

Subject: Re: Possible defect in [class.mem]/17
From: Tam S. B. (cpplearner_at_[hidden])
Date: 2019-06-07 05:55:41


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_[hidden]> on behalf of Alexander via Std-Discussion <std-discussion_at_[hidden]>
Sent: Tuesday, June 4, 2019 20:51
To: std-discussion_at_[hidden]
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.


STD-DISCUSSION list run by herb.sutter at gmail.com

Older Archives on Google Groups