You must make your Router class a class class.
template<std::size_t N> class Router{ std::array<Port,N> ports; ... }
if you want to specify the size of ports at the Router level . By the way, N must be a constant known from compilation time.
Otherwise, you will need std::vector .
source share