My code resembles something in these lines.
class A { public: A(int i) { printf("hello %d\n", i); } ~A() { printf("Goodbye\n"); } } std::vector(10, A(10));
I notice that hi prints once. Apparently, it is implied that the vector allocates space for the element but does not create it. How do I create 10 objects A?
source share