Subject: Re: [Boost-bugs] [Boost C++ Libraries] #3035: non-standard integral types not fully supported
From: Boost C++ Libraries (noreply_at_[hidden])
Date: 2009-05-15 11:39:55
#3035: non-standard integral types not fully supported
-------------------------------------+--------------------------------------
Reporter: Maxim.Yanchenko_at_[hidden] | Owner: johnmaddock
Type: Bugs | Status: new
Milestone: Boost 1.40.0 | Component: type_traits
Version: Boost 1.39.0 | Severity: Problem
Resolution: | Keywords:
-------------------------------------+--------------------------------------
Comment(by nasonov):
I added a TODO to the integral_promotion.hpp some time ago which says
"common macro for this #if. Or better yet, PP SEQ of non-standard types."
So, if we define BOOST_TT_AUX_NON_STANDARD_INTS:
{{{
#if (defined(BOOST_MSVC) && (BOOST_MSVC < 1300)) \
|| (defined(BOOST_INTEL_CXX_VERSION) && defined(_MSC_VER) &&
(BOOST_INTEL_CXX_VERSION <= 600)))
# define BOOST_TT_AUX_NON_STANDARD_INTS \
(__int8) (unsigned __int8) \
(__int16)(unsigned __int16) \
(__int32)(unsigned __int32)
#elif defined(__BORLANDC__) && (__BORLANDC__ == 0x600) && (_MSC_VER <
1300)
# define BOOST_TT_AUX_NON_STANDARD_INTS \
(__int8) (unsigned __int8) \
(__int16)(unsigned __int16) \
(__int32)(unsigned __int32) \
(__int64)(unsigned __int64)
#endif
}}}
we should be able to change code in is_integral.hpp to something like:
{{{
#ifdef BOOST_TT_AUX_NON_STANDARD_INTS
#define BOOST_TT_AUX_DECL(r, data, type)
BOOST_TT_AUX_BOOL_TRAIT_CV_SPEC1(is_integral, type, true)
BOOST_PP_SEQ_FOR_EACH(BOOST_TT_AUX_DECL, _,
BOOST_TT_AUX_NON_STANDARD_INTS)
#undef BOOST_TT_AUX_DECL
#endif
}}}
and similarly in integral_promotion.hpp:
{{{
#ifdef BOOST_TT_AUX_NON_STANDARD_INTS
#define BOOST_TT_AUX_DECL(r, data, type)
BOOST_TT_AUX_PROMOTE_NONSTANDARD_TYPE(type)
BOOST_PP_SEQ_FOR_EACH(BOOST_TT_AUX_DECL, _,
BOOST_TT_AUX_NON_STANDARD_INTS)
#undef BOOST_TT_AUX_DECL
#endif
}}}
It's not as easy for make_signed and make_unsigned but they convert a non-
standard type to a corrensponding standard type, e.g.
make_unsigned<__int8>::type -> unsigned char.
This macro can be also used in tests.
Alex
-- Ticket URL: <https://svn.boost.org/trac/boost/ticket/3035#comment:2> Boost C++ Libraries <http://www.boost.org/> Boost provides free peer-reviewed portable C++ source libraries.
This archive was generated by hypermail 2.1.7 : 2017-02-16 18:50:00 UTC