Boost logo

Boost Users :

From: Daniel James (daniel_james_at_[hidden])
Date: 2007-10-20 20:20:59


Chris Weed wrote:
> {
> return t.get<0>();
> }

Change that to:

    {
      return t.template get<0>();
    }

Chris Weed wrote:
> I was mistaken about what was generating the compile error. I think it
> had to do with there not being a get member function in
> boost::tuple<int> This confused me since I thought I had used that in
> the past, and the doc's suggested it worked.
> Chris

Actually, there is a get member. The problem was that the compiler
didn't know the type of t when compiling the function (because t is a
template dependent name), so you need to tell it that 'get' is a
template method. Because it didn't know that, it assumed the angle
brackets were actually 'less than' and 'greater than' symbols, leading
to the confusing error messages.

Daniel


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