What does the second parameter in this signature mean?

std::vector<int> interpret(const std::string &src, const std::vector<int> &input = {});

I understand everything about the signature, with the exception of setting the link input to {}. What does it mean?

+4
source share
1 answer

=enters the default value for the parameter ... {}in this case indicates empty vector. Therefore, you can call a function with one argument, but it inputwill be empty.

+7
source

Source: https://habr.com/ru/post/1617924/


All Articles