I am trying to declare an iterator of type std::initializer_list
as it is described in this answer.
But I always get this error:
error: 'iterator' is not a member of 'std::initializer_list<int>'
May someone guide me how to declare an iterator of type std::initializer_list
?
EDIT:
This code for example will not work. In addition, The compiler that I use supports the new standard draft
int findCommon(std::initializer_list<int> nums)
{
std::initializer_list<int>::iterator it;
for (it = nums.begin() ; it != nums.end() ; ++it)
{
std::cout << *it << std::endl;
}
return 1;
}