Boost logo

Boost Users :

Subject: Re: [Boost-users] [type_traits] will the future has_operator_left_shift be able to test if a type is serializable to a stream ?
From: Mathieu Champlon (mathieu.champlon_at_[hidden])
Date: 2011-02-04 10:55:33


On 03/02/2011 23:03, Frédéric Bron wrote:
>> The #include goes fine but I still get the following error :
>> error C4430: missing type specifier - int assumed. Note: C++ does not
>> support default-int
>> With the code :
>> BOOST_STATIC_ASSERT(( boost::has_operator_left_shift< int, int>::value ));
> New version here:
> http://www.boostpro.com/vault/index.php?action=downloadfile&filename=type_traits-dos.tar.bz2&directory=Extension&
>

Yes this fixes the error.

Now :

   BOOST_STATIC_ASSERT(( boost::has_operator_left_shift< std::ostream,
int >::value ));

Yields :

boost/type_traits/detail/has_binary_operator.hpp(103) : warning C4913:
user defined binary operator ',' exists but no overload could convert
all operands, default built-in binary operator ',' used
         boost/type_traits/detail/has_binary_operator.hpp(139) : see
reference to class template instantiation
'boost::detail::has_operator_left_shift_impl::has_operator_left_shift_impl<LHS,RHS,RET>'
being compiled
         with
         [
             LHS=std::ostream,
             RHS=int,
             RET=void
         ]
         (.....) : see reference to class template instantiation
'boost::has_operator_left_shift<LHS,RHS>' being compiled
         with
         [
             LHS=std::ostream,
             RHS=int
         ]

But no more errors, and it seems to work fine despite the warning.

Thanks !

MAT.


Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net