I am currently working on a microcontroller, which makes any memory usage very expensive and thus I want to reduce the footprint as much as I can. Since there are many configuration parameters defined as constants, I think there is some potential for optimization.
Basically, I need something like an enum for non-integral types. However the solution looks like, it must meet the following constraints:
- compile-time constant, thus no memory footprint at all
- can be hidden in namespaces (thus,
#defineis no option here) - no function-like access (thus,
constexpris no option here) - can be of any type (but type safe, thus
reinterpret_castis no option here) - no libraries other than C++11 used
Any ideas are welcome! :)
Aucun commentaire:
Enregistrer un commentaire