cplusplus / draft

C++ standards drafts
http://www.open-std.org/jtc1/sc22/wg21/
5.61k stars 739 forks source link

Eliminate redundant use of typename throughout library P2150 #3637

Open AlisdairM opened 4 years ago

AlisdairM commented 4 years ago

Following the adoption of http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2018/p0634r3.html many uses of ‘typename’ throughout the library are now redundant. They should be eliminated to provide a cleaner modern presentation of the standard library, much as when we switched from typedef to using.

Such a wide-reaching change is likely a policy decision to be approved by LWG, but application is more likely an editorial issue (requiring careful review) to avoid overloading precious LWG time.

Suggest this should be an issue for C++23 to avoid disrupting the imminent progress of C++20, and allowing adequate time for reviews. May consider updating one clause at a time, to ease review load.

jensmaurer commented 4 years ago

Please submit an LWG issue for the policy decision. It would also be helpful to identify patterns of "typename" use that are deemed redundant. (Possibly, not all technically-redundant "typename"s should be removed, for clarity of exposition.)

AlisdairM commented 4 years ago

I will try to put a paper into the post-Prague mailing, collecting the different patterns of typename usage that can safely be simplified, and those that cannot. Hopefully much of the discussion can occur online, prior to the Varna meeting, and without distracting from Prague and C++20.

AlisdairM commented 4 years ago

Missed post-prague, but expect a paper with detailed examples for reference for future library wording too in plenty of time for the pre-Varna mailing.

AlisdairM commented 4 years ago

The paper was in the April mailing: http://wg21.link/P2150 P2150 Down with typename in the library! cplusplus/papers#862 Using wg21.link reference so we will get a 'live' link to any updates following LWG feedback.

zhihaoy commented 2 years ago

All typename in "= typename" can be removed.

AlisdairM commented 1 year ago

This is not going to happen for C++23. The target should be updated to C++26 (or later?)

jensmaurer commented 1 year ago

Milestone adjusted.