dimanche 24 mars 2019

Is there good practices for where to declare using in C++?

Is there good pratices to declare a using (for typedef like usage) ?

For example if I have a class with a std::array<std::array<T, W>, H> member and I want to ease both reading and writing with a using like this

template<typename T, uint32_t H, uint32_t W>
using matrix = std::array<std::array<T, W>, H>;

Where should I put this ? Inside the class declaration or outside or even in a separate header file ?

Thanks

Aucun commentaire:

Enregistrer un commentaire