CppCast cover image

Carbon, with Richard Smith

CppCast

00:00

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.

Transcript
Play full episode

The AI-powered Podcast Player

Save insights by tapping your headphones, chat with episodes, discover the best highlights - and more!
App store bannerPlay store banner
Get the app