Avoid using magic numbers. For example, you could write:
Code:
private:
static const std::size_t max_size = 5;
int array[max_size];
Then use max_size elsewhere too. Also, if you intend to use a using directive for the std namespace, then do not use
array as a variable name as it is the name of a standard container.
It isn't. Why aren't you making use of the idx parameter?