How do Concepts differ from Interfaces?

后端 未结 4 1810
栀梦
栀梦 2020-12-15 04:22

How do Concepts (ie those recently dropped from the C++0x standard) differ from Interfaces in languages such as Java?

4条回答
  •  自闭症患者
    2020-12-15 05:13

    It's more or less a difference in the point of view. While an interface (as in C#) is specified similar to a base class, a concept can also be matched automatically (similar to duck-typing in Python). It is still unclear to which level C++ is going to support automatic concept matching, which is one of the reasons why they dropped it.

提交回复
热议问题