Talk:cpp/experimental/propagate const
From cppreference.com
< Talk:cpp
[edit] Topical=
Not even a month old and already brought up on StackOverflow (in comments to http://stackoverflow.com/q/31833209 ) --Cubbi (talk) 06:18, 6 August 2015 (PDT)
[edit] T -> P?
I think it would be more appropriate to have the template parameter and derived entities be named after what they denote. In case of this template that would be a pointer (type). (To me "T" looks more like a name for the type of elements of a container or the type a pointer points to.)
As this change would require changing a lot of pages, I'd like to get some consensus on it. -- Radix (talk) 16:20, 11 April 2020 (PDT)
- I think it makes sense to name informally-constrained template parameters with the name of the constraint (here, perhaps T => PointerLike) --Cubbi (talk) 06:19, 13 April 2020 (PDT)
- I disagree:
- We should not conflate a type with a constraint (concept) it models. Even if it is informal — What if someday the concept gets formalized? We would need to write template<PointerLike PointerLike>. Also, you wouldn't name a copy constructible type CopyConstructible, would you?
- How would derived entities be named? (With
T
renamedP
I also see theses renamings:t
=>p
,ct
=>cp
,U
=>Q
,t_
=>p_
.)
- -- Radix (talk) 15:33, 13 April 2020 (PDT)
- that's how non-generic type template parameters have been named since C++98 throughout the standard and this reference. Pick any algorithm, e.g. cpp/algorithm/search. You have ForwardIt, ExecutionPolicy, BinaryPredicate, and Searcher. --Cubbi (talk) 07:16, 14 April 2020 (PDT)
-
PointerLike
(alongwith names with PascalCase) will not be a concept name in future standard revisions since the decision that not to use PascalCase has been made in P1754R1. --Fruderica (talk) 02:41, 15 April 2020 (PDT)
- I disagree: