Creational use cases

"When dealing with "creational" use cases, try to find another aggregate or factory you can move that responsibility to. Sometimes the factory is just a static method (good for "context"/"intent" capturing), sometimes it's an instance method of another aggregate (good place for "data" inheritance), sometimes it's an explicit factory…

`std::array` is an aggregate

The problem Consider the following type aliasing: template<std::size_t N> using square_matrix = std::array< std::array<int, N>, N>; Intuitively, one may try to use brace-initialization as follows: square_matrix<3> m = { {1, 2, 3}, {4, 5, 6}, {7,…