CppCast cover image

Carbon, with Richard Smith

CppCast

CHAPTER

The Difference Between C++ 20 Concepts and Carbon Generics?

Carbon's generic system has type constraints that are a little bit like C++ 20 concepts. But interfaces in carbon are nominal rather than structural, by which I mean you don't satisfy an interface just by having the right member functions. So for instance, if you implement a comparable interface and you have a function compare, you don't have to have a member function called compare. That can just be part of the way you implement that interface. Carbon also supports templates that are checked by substitution as a mechanism of interoperating with and migrating from C ++ code.

00:00
Transcript
Play full episode

Remember Everything You Learn from Podcasts

Save insights instantly, chat with episodes, and build lasting knowledge - all powered by AI.
App store bannerPlay store banner