15:58 note that it might be better to move such “inner requires” outside, because concepts that are boolean expressions have ‘subsumption rules’ which are meant to help the compiler with potential conflicts. This example will look something like “… concept ConcatPlus = requires(T a, U b) {a+b;} && same_as && …”.
Near realtime software like audio processing tries to eliminate any source of delays during the execution of the critical path. Resolving vtable when you use interfaces could be a source of such delays
Concepts are kind of (a lax version of) compile-time interfaces. Rust & Swift use the same language feature for both static and dynamic interfaces, but I imagine "strict" templates like this would be hard to add to C++ without breaking someone's code.
No i would really say just the error-messages are a wwwaaaaayyyy bigger and more helpful feature of concepts. Most code i see does not write templates but is trying to use them. And most of the time when somebody has a problem the compiler "clearly tells them what is wrong" - in line 56 of 491 lines of error-messages in a giant wall of text. Once you have containers-of-containers and just the type alone is 5 lines of code you really do not want to use them anymore cause if you then have something simple like trying to emplace-back a templated class that 3 layers down contains a unique_ptr ... you will curse and the crap that are C++ template compiler warnings.
GPT is really useful here, btw.. Just copypaste the error message, and preface it with something like "Explain this error:". Which is, simultaneously, also a good indicator, that the system is indeed quite ridiculous as it is, if you need an AI to understand an error message...
This is great and all. But I don't understand why you need templates at all. This Processor thing is a picturebook use case for inheritance. Just have a processor interface class with a virtual process member and a reset function, and overload as required with your various processors. then you can shove whatever processors you want any place you want and everything works out by way of polymorphism.
Great talk!
15:58 note that it might be better to move such “inner requires” outside, because concepts that are boolean expressions have ‘subsumption rules’ which are meant to help the compiler with potential conflicts. This example will look something like “… concept ConcatPlus = requires(T a, U b) {a+b;} && same_as && …”.
Could someone explain why you would need a concept for something that has a Process function instead of an interface
Near realtime software like audio processing tries to eliminate any source of delays during the execution of the critical path. Resolving vtable when you use interfaces could be a source of such delays
Concepts are kind of (a lax version of) compile-time interfaces. Rust & Swift use the same language feature for both static and dynamic interfaces, but I imagine "strict" templates like this would be hard to add to C++ without breaking someone's code.
No i would really say just the error-messages are a wwwaaaaayyyy bigger and more helpful feature of concepts. Most code i see does not write templates but is trying to use them. And most of the time when somebody has a problem the compiler "clearly tells them what is wrong" - in line 56 of 491 lines of error-messages in a giant wall of text.
Once you have containers-of-containers and just the type alone is 5 lines of code you really do not want to use them anymore cause if you then have something simple like trying to emplace-back a templated class that 3 layers down contains a unique_ptr ... you will curse and the crap that are C++ template compiler warnings.
GPT is really useful here, btw.. Just copypaste the error message, and preface it with something like "Explain this error:".
Which is, simultaneously, also a good indicator, that the system is indeed quite ridiculous as it is, if you need an AI to understand an error message...
This is great and all. But I don't understand why you need templates at all. This Processor thing is a picturebook use case for inheritance. Just have a processor interface class with a virtual process member and a reset function, and overload as required with your various processors. then you can shove whatever processors you want any place you want and everything works out by way of polymorphism.
Concepts are great.
TDD is overrated.
More "explained hurredly" than "made easy" I'm afraid. Developers don't always make good educators.
Then hoist your ass up there and do it better