[LLVMdev] next

Reid Kleckner rnk at mit.edu
Mon Nov 16 00:36:03 PST 2009


C++ newbie question: But doesn't all the code in LLVM avoid "using
namespace std"?  It seems like the solution is to just never use both
the llvm and std namespace in the C++ file.

Reid

On Mon, Nov 16, 2009 at 3:21 AM, John McCall <rjmccall at apple.com> wrote:
> Evan Cheng wrote:
>> I am pretty sure the .cpp files always explicitly use "llvm" namespace. Look for:
>> using namespace llvm;
>>
>> Is that sufficient?
>>
>
> No;  once it's visible through ADL (because ilist<>::iterator extends
> std::iterator) there's no hiding or precedence mechanism we can
> exploit.  On the other hand, AFAICT std::next is interchangeable with
> llvm::next;  we should be able to replace llvm::next with 'using
> std::next' in C++0x builds.
>
> John.
> _______________________________________________
> LLVM Developers mailing list
> LLVMdev at cs.uiuc.edu         http://llvm.cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev
>




More information about the llvm-dev mailing list