|
Boost Testing : |
From: Toon Knapen (toon.knapen_at_[hidden])
Date: 2005-06-06 02:17:30
Aleksey Gurtovoy <agurtovoy_at_[hidden]> wrote:
>Toon Knapen writes:
>> John Maddock <john_at_[hidden]> wrote:
>>> However there was one change to is_enum since the last
>>> release
>>>
>(http://cvs.sourceforge.net/viewcvs.py/boost/boost/boost/type_traits/is_enum.hpp?r1=1.12&r2=1.13)
>>> and does affect the code that produces the error. So you could try
>>> reverting the code and see if that fixes things for vacpp.
>>
>> OK, thanks I will try that. So if I understand correctly, the
>> process_jam_log program does not compile as it should because it uses the
>
>> type_traits?
>
>Yes, indirectly.
I looked into the problem and when I compile process_jam_log.cpp with vacpp
I easily reproduce the problem on line 95 of is_enum.hpp (see attached error
log).
So I tried to figure out what exactly poses a problem for vacpp and I
implemented following little test-case which is AFAICT totally similar to
the is_enum implementation (see below). However the code below compiles
fine!?
I'm not familiar with the Boost.PP library however so maybe the test-case
below is not identical to the is_enum implementation?
<working test-case>
#include <boost/type_traits/is_convertible.hpp>
#include <string>
#include <iostream>
enum Key { foo, bar } ;
template < bool T = true >
struct Test
{} ;
template <>
struct Test< false > {
template < typename T > struct type : boost::is_convertible< typename
boost::add_reference< T >::type, boost::detail::int_convertible > {} ;
} ;
int main()
{
std::cout << Test< false >::type< Key >::value << std::endl ;
std::cout << Test< false >::type< std::string >::value << std::endl ;
return 0 ;
}
</working test-case>