This is the mail archive of the gcc@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

std::count leaked outside namespace std?


Hi,

Here's a simple program:

#include <algorithm>
#include <vector>

int main()
{
  std::vector<int>  vec;
  count(vec.begin(), vec.end(), 0);   // shouldn't this be std::count ?
}

The above compiles successfully, but I think it shouldn't. I expect a
message like "error: `count` not declared in scope" because I meant to
say std::count. Isn't this a bug, or am I missing something?

Behaviour is reproducible with both GCC 4.7 and 4.8.

PS: I'm not subscribed to mailing list, please keep me in cc.

Thanks,
Satish


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]