Boost logo

Boost :

From: Dale Peakall (dale.peakall_at_[hidden])
Date: 2001-04-11 13:55:46


There's a problem with tuple (from the vault) on MSVC SP5.

The following program demonstrates the problem:

#include <iostream>
#include <boost/tuple.hpp>

int main() {
  boost::tuple<int, int, int> t = boost::tuple<3, 9, 27>;

  std::cout << "1: " << boost::get<1>(a) << std::endl;; // output's 27!
  // likewise for get<2> and get<3> all output 27

  return 0;
}

I don't see that the tuple library is at fault though. It appears to
be an MSVC problem as the instantiation of:

template<int N, typename Tuple>
typename tuple_element_type_ref<N, Tuple>::RET
get(Tuple & t) {
  int n = N; // added for debugging: n == 3!
  return tuple_element<N>::get(t);
}

Is instantiated with N == 3 even though explicitly provided at call as 1.

Although I was under the impression that this specific version of tuple
was supposed to work with VC (n.b. this instance is not tested for in
tuple_test.cpp).

        - Dale.


Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk