I find that modern C ++ initializer lists are very useful for initializing objects to remove the need to define your own constructor:
struct point { float coord[3]; }; point p = {1.f, 2.f, 3.f};
However, this does not work when my class inherits from another class:
template<typename T> class serializable { protected: serializable() = default; ...
I tried adding point() = default; to my point class, but that didn't work either. How can I initialize a point using a list of initializers?
c ++ inheritance c ++ 11 list-initialization initializer-list
Amxx
source share