Boost logo

Boost Users :

Subject: Re: [Boost-users] zip_iterator.hpp / boost::tuple requires a using namespace std!
From: mark pashley (mark.pashley_at_[hidden])
Date: 2012-02-29 15:36:04

Hi Lars,

I used to pre-format the message, I guess that the pre-formatting
is corrupted when sent out to end user's of the list. ...

The gist of the problem is that the following template does not compile
without the "using namespace std" statement:

template <class T>
struct MapZipHelperImpl
    typedef typename boost::tuple< const T&, const T& > iter_value_type;

  void operator()( const iter_value_type& iter_value )
        using namespace std; // without this the next line does not
        typename T::first_type val = iter_value.get<0>().first ;

The error is:

error: expected primary-expression before ‘)’ token

I believe that the "using namespace std;" statement should not be necessary.
Is it possible that a header file is missing a std:: qualification and
in-advertantly depending on client code to include the "using namespace
std;" statement?

It took a t of effort to simplify the code that was causing the problem and
produce a minimal example.

View this message in context:
Sent from the Boost - Users mailing list archive at

Boost-users list run by williamkempf at, kalb at, bjorn.karlsson at, gregod at, wekempf at