I found this constructor in a C++ book. Unfortunatly the authors didn't think it's worth any explanation or I'm too blind to find it
I don't understand the blue part. What does it do? I would expect it to do nothing because there is nothing between { and } and there is no further implementation for the constructor, but _stack(capacity) looks like a possible constructor for the vectorCode:class iStack { public: iStack(int capacity): _stack(capacity), _top(0) {} [...snip...] private: int _top; vector<int> _stack; }
Does it initialize _stack and _top ? If so, why not beween the { and } ?