|
|
|
|
|
by embeng4096
96 days ago
|
|
Is there an example of the generic programming that you've found useful? The extent of my experience has been being able to replace functions like convert_uint32_to_float and convert_uint32_to_int32 by using templates to something like convert_uint32<float>(input_value), and I didn't feel like I really got much value out of that. My team has also been using CRTP for static polymorphism, but I also feel like I haven't gotten much more value out of having e.g. a Thread base class and a derived class from that that implements a task function versus just writing a task function and passing it xTaskCreate (FreeRTOS) or tx_thread_create (ThreadX). Typed compile-time computation is nice, though, good point. constexpr and such versus untyped #define macros. |
|