Opened 13 years ago

Closed 13 years ago

#3084 closed Bugs (fixed)

integer_traits for std::streamsize not defined for Visual C++ in 64-bit when language extensions are off

Reported by: boost@… Owned by: Daryle Walker
Milestone: Boost 1.40.0 Component: integer
Version: Boost 1.39.0 Severity: Showstopper
Keywords: Cc:

Description

The following does not compile if you disable language extensions and build in 64-bit:

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

int main()
{
  boost::integer_traits<std::streamsize>::const_max;
}

This makes it impossible to use boost date_time in 64-bit.

The fix is below (add to integer_traits.hpp):

#if defined(BOOST_HAS_MS_INT64) && !defined(_MSC_EXTENSIONS)
template<>
class integer_traits< __int64 >
    : public std::numeric_limits< __int64 >,
      public detail::integer_traits_base< __int64, _I64_MIN	, _I64_MAX>
{ };
#endif

Change History (3)

comment:1 by boost@…, 13 years ago

By the way, the error occurs when compiling greg_month.cpp in 64-bit without language extensions.

comment:2 by anonymous, 13 years ago

Component: date_timeinteger
Owner: changed from az_sw_dude to Daryle Walker

comment:3 by John Maddock, 13 years ago

Resolution: fixed
Status: newclosed

(In [57863]) Add support for MS style int64 when long long is not available. Fixes #3084.

Note: See TracTickets for help on using tickets.