goodfella / googletest

Automatically exported from code.google.com/p/googletest
BSD 3-Clause "New" or "Revised" License
0 stars 0 forks source link

incompactible with VC10 #276

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
Can not be compiled with VC10.
"gtest-1.4.0\include\gtest\internal\gtest-tuple.h(745): error C3855:
'std::tr1::tuple_element': template parameter '_Idx' is incompatible with
the declaration"

gtest1.4.0, VC10 Express, Windows XP

Original issue reported on code.google.com by everwa...@gmail.com on 14 Apr 2010 at 10:36

GoogleCodeExporter commented 9 years ago

Original comment by vladlosev on 14 Apr 2010 at 3:22

GoogleCodeExporter commented 9 years ago
This problem still exists for 2.4.1 ... here is why

gtest-tuple.h line 741:
template
struct tuple_element {
  typedef typename gtest_internal::TupleElement<
      k < (tuple_size::value), k, Tuple>::type type;
};

The tuple_element in stl expects size_t as first parameter, and size_t for x64 
is a bit larger than size_t for Win32. Hence the error:

error C3855: 'std::tr1::tuple_element': template parameter '_Idx' is 
incompatible with the declaration

So the correct code for this should look like this:

gtest-tuple.h line 741:
template <size_t k, class Tuple>
struct tuple_element {
  typedef typename gtest_internal::TupleElement<
      k < (tuple_size::value), k, Tuple>::type type;
};

Original comment by dimitry....@gmail.com on 23 Nov 2012 at 3:51