[LLVMdev] name collision - llvm::tie and boost::tie

Andreas Fredriksson deplinenoise at gmail.com
Fri Sep 23 00:07:18 PDT 2005

On 9/23/05, Vladimir Prus <ghost at cs.msu.su> wrote:
> In fact, I believe that
>    using namespace llvm;
>    using namespace boost;
>    using boost::tie;
> should resove the problem witout needed to explicitly nominate all boost names
> you use. Except that this does not work on global scope, but only in
> namespace:


Also, it might be an idea to exploit Koenig lookup if either `tie'
function is a free function and uses types from its own namespace.

If these definitions hold:

namespace foo {
   struct bar {};
   do_something(const bar&);

You can call do_something() without the namespace qualification due to
Koenig lookup.

(global namespace)
using foo::bar;
bar b;
do_something(b); // resolves to foo::do_something()

Maybe this helps.


"Give a man a fire and he's warm for a day; set him on fire and he's
warm for the rest of his life" -- Terry Pratchett

More information about the llvm-dev mailing list