[LLVMdev] Proposed implementation of N3333 hashing interfaces for LLVM (and possible libc++)

Ahmed Charles ahmedcharles at gmail.com
Wed Feb 29 22:03:03 PST 2012


> +  // Helper for test code to print hash codes.
> +  void PrintTo(const hash_code &code, ::std::ostream *os) {
>
> What's with the extra leading :: before std::?

Have you ever tried:

namespace foo {
class std {};
}
using namespace foo;

#include <vector>

Well, I'm not sure that Chandler is guarding against this possibility,
but most library implementations of the standard use ::std::
everywhere to avoid this potential for ambiguity.




More information about the llvm-dev mailing list