4 ms·
Ask HN: What is difference between C++ Concepts and Protocol programming?
I have read that the idea behind the proposed Concepts is that you can restrict the types that a template accepts to those that fit a "concept" you've previously defined. This seems very similar to what protocols are for in other languages: You define a protocol that has one or more functions, and then a class can "conform" to that protocol, then you can write generic functions that only operate on those that conform.
Are these not similar ideas?