Boost logo

Boost Users :

Subject: Re: [Boost-users] zip_iterator.hpp / boost::tuple requires a using namespace std!
From: Lars Viklund (zao_at_[hidden])
Date: 2012-02-29 17:29:48


On Wed, Feb 29, 2012 at 12:36:04PM -0800, mark pashley wrote:
> void operator()( const iter_value_type& iter_value )
> {
> using namespace std; // without this the next line does not
> compile!
> typename T::first_type val = iter_value.get<0>().first ;
> }
> };
>
> error: expected primary-expression before ‘)’ token

I believe you need to say:
  iter_value.template get<0>().first

The use of 'template' there is akin to the use of 'typename' when it
comes to types.

The parse otherwise is iter_value.get < 0 > ().first
which explains your error rather directly.

Without the 'template' keyword, it's interpreted as a member with some
less-than and greater-than comparisons.

-- 
Lars Viklund | zao_at_[hidden]

Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net