2 ms·
Values can be arbitrary objects and a new one need to be provided at every call site: virtual void foo(std::vector<int> x = {10, 20, 30}); You can't just s
by gpderetta 3y ago
Values can be arbitrary objects and a new one need to be provided at every call site:
virtual void foo(std::vector<int> x = {10, 20, 30});
You can't just store a single std::vector{10, 20, 30}. You would need to store a (virtual) factory function instead which, while doable, adds more overhead.