Boost logo

Boost :

From: Pavel Vozenilek (pavel_vozenilek_at_[hidden])
Date: 2006-04-02 15:56:50


"Tobias Schwinger" wrote:

> The review of Alexander Nasonov's Promotion Traits start today.
> http://cpp-experiment.sourceforge.net/promote-20050917.tar.gz
>

Bellow are few notes from me. I do not vote here as I am
not that much knowledgeable of metaprogramming.

/Pavel

1. The documentation should really start with Rationale
   section and should contain complete examples.
   Examples written in this thread would be good start.

2. Includes should use

#include <boost/config.hpp>

notation rather than

#include "boost/config.hpp"

3. I got problems with Windows Intel 9.0:

compiling...
promote_enum_test.cpp
icl: warning: problem with Microsoft compilation of

'P:\promote-20050917\libs\type_traits\test\promote_enum_test.cpp'
P:\promote-20050917\libs\type_traits\test\promote_util.hpp(30): error:
incomplete type is not allowed
      BOOST_STATIC_ASSERT(( ::boost::is_same< promoted , Promoted
>::value ));
      ^
          detected during instantiation of "void test<T,Promoted>() [with
T=UIntEnum, Promoted=unsigned int]"
P:\promote-20050917\libs\type_traits\test\promote_util.hpp(31): error:
incomplete type is not allowed
      BOOST_STATIC_ASSERT(( ::boost::is_same< promoted_c , Promoted const
>::value ));
      ^
          detected during instantiation of "void test<T,Promoted>() [with
T=UIntEnum, Promoted=unsigned int]"
P:\promote-20050917\libs\type_traits\test\promote_util.hpp(32): error:
incomplete type is not allowed
      BOOST_STATIC_ASSERT(( ::boost::is_same< promoted_v , Promoted
volatile >::value ));
      ^
          detected during instantiation of "void test<T,Promoted>() [with
T=UIntEnum, Promoted=unsigned int]"
P:\promote-20050917\libs\type_traits\test\promote_util.hpp(33): error:
incomplete type is not allowed
      BOOST_STATIC_ASSERT(( ::boost::is_same< promoted_cv, Promoted const
volatile >::value ));
      ^
          detected during instantiation of "void test<T,Promoted>() [with
T=UIntEnum, Promoted=unsigned int]"
compilation aborted for
P:\promote-20050917\libs\type_traits\test\promote_enum_test.cpp (code 2)
Error executing cl.exe.

------------

promote_extentions_test.cpp
icl: warning: problem with Microsoft compilation of

'P:\promote-20050917\libs\type_traits\test\promote_extentions_test.cpp'
P:\promote-20050917\libs\type_traits\test\promote_extentions_test.cpp(23):
error: enumeration value is out of "int"

range
      LongLongEnum2_value =
boost::integer_traits<boost::long_long_type>::const_max
                            ^
[ snip many similar ]

P:\promote-20050917\libs\type_traits\test\promote_util.hpp(30): error:
incomplete type is not allowed
      BOOST_STATIC_ASSERT(( ::boost::is_same< promoted , Promoted
>::value ));
      ^
          detected during instantiation of "void test<T,Promoted>() [with
T=LongLongEnum1,

Promoted=boost::long_long_type={__int64}]"

[ snip many similar ]

4. Intel 7.0 seems to be right out,
   I was not able to compile any example.

5. Playing with BCB: I got some promising success
   but full port would require longer work.
   I can help here if it gets accepted into Boost.

As an appetizer: all [::boost::] need to be converted
into [boost::] (BCB doesn't like the leading ::)
and there are some strange issues with namespaces;
it feels that

namespace boost {
namespace type_traits { namespace detail {
BOOST_TT_AUX_BOOL_TRAIT_DEF1(need_promotion, T, boost::is_enum<T>::value)
...

put the macro generated code into wrong namespace.

6. In

#if (defined(BOOST_MSVC) && (BOOST_MSVC == 1200)) \
    || (defined(BOOST_INTEL_CXX_VERSION) && defined(_MSC_VER) &&
(BOOST_INTEL_CXX_VERSION <= 600)) \
    || (defined(__BORLANDC__) && (__BORLANDC__ == 0x600) && (_MSC_VER ==
1200))

just all versions of BCB should be covered.
5.5, 5.6 and 5.8 do have the __intX thing.

BCB version 0x600 doesn't exist yet.

Similarly all Windows Intel compilers I know about have __intX
as a separate type - the check <= 600 should be omitted too.

EOF


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