Is this a good idea for a library developer to define a macro while we wait (hopefully) for inbound concepts ? What are the advantages and disadvantages of this approach?
Macro examples (A. Stepanova):
#define TotallyOrdered typename
#define Pointer typename
#define Number typename
#define Unsigned typename
#define Integral typename
#define InputIterator typename
#define OutputIterator typename
#define ForwardIterator typename
#define BidirectionalIterator typename
#define RandomAccessIterator typename
...
Usage example (from me):
template<ForwardIterator It>
It min_element(It first, It last) { ... }
Idea:
- no concepts yet, this is a simple old code template
- When the concepts finally arrive, you can delete all the macros or rename them if the names of the concepts are different (you can do this easily in any decent IDE), and then delete or simply override these macros in the concept expressions
- Take advantage of future features without rewriting complex boilerplate code.
- , "" .
< > :
A. Amazon A9, , typename , , "- " ++, . , ( , , ). , .
>
< > : GPU ( , , zipped iterators ..), , ,
>