Easton Man's Channel
02:53 · Apr 21, 2023 · Fri
Daniel Lemire's blog
Defining interfaces in C++: concepts versus inheritance
Telegraph
|
source
Telegraph
Defining interfaces in C++: concepts versus inheritance
In a previous blog post, I showed how you could define ‘an interface’ in C++ using concepts. For example, I can specify that a type should have the methods has_next, next and reset: template <typename T> concept is_iterable = requires(T v) { { v.has_next()…
Home
Powered by
BroadcastChannel
&
Sepia