News for hackers. Stuff that matters.
Re:Concepts: The Future of Generic Programming [pdf] by lobster_johnson on Wednesday December 21, 2016 @02:09AM (#13227351)
Can concepts be used like traits in non-generic code? Which is to say, can it be used as a type name of a variable or function argument? Because there seems to be a lot of overlap between a concept and a pure virtual class, both of which define function signatures. But if concepts are only for templates, and you still have to use pure virtual classes to express traits, that seems like a missed opportunity to me. But I may be missing some nuance here.
Re:Concepts: The Future of Generic Programming [pdf] by matt_d on Wednesday December 21, 2016 @11:28AM (#13230326)
> can it be used as a type name of a variable or function argument?

If I understand correctly, placeholders may work for this. This use is described in the "Programming with placeholders" section of the "Introducing concepts" article: https://accu.org/index.php/journals/2157

The remaining articles in Andrew Sutton's C++ concepts series are pretty good, too; so, just in case anyone is interested, here are the links:

- "Defining Concepts" - https://accu.org/index.php/journals/2198

- "Overloading with Concepts" - https://accu.org/index.php/journals/2316

Re:Concepts: The Future of Generic Programming [pdf] by lobster_johnson on Wednesday December 21, 2016 @01:17PM (#13231305)
If I understand the first article about placeholders correctly, concepts are indeed intended to be used where you can use ordinary types, just like traits. That looks really cool, if it ends up in the standard.
Re:Concepts: The Future of Generic Programming [pdf] by steveklabnik on Wednesday December 21, 2016 @09:32AM (#13229358)
It's not clear to me; I didn't see it in this pdf but might have missed it.