Boost logo

Boost :

From: Alexander Nasonov (alnsn_at_[hidden])
Date: 2006-01-07 09:06:51


Alexander Nasonov wrote:
>>>Tobias Schwinger wrote:
>>>>Sorry for jumping in here. But I believe that
>>>>
>>>> #ifndef BOOST_NO_SFINAE
>>>> namespace boost { namespace type_of {
>>>> template<typename T>
>>>> typename enable_if<is_function<T>, T &>::type
>>>> ensure_obj(T &);
>>>> } }
>>>> #endif
>>>> // verified to solve the problem with GCC 3.2.3

[skiped]

> It didn't compile because I included enable_if.hpp and is_function.hpp
> only for emulation mode. Now your code compiles fine.

I added

     int foo(bool);

     BOOST_STATIC_ASSERT((
         boost::is_same<BOOST_TYPEOF(foo), int(bool)>::value
     ));

to the end of libs/typeof/test/function.cpp

and

     typedef int (fun)(bool);
     fun &foo();

     BOOST_STATIC_ASSERT((
         boost::is_same<BOOST_TYPEOF(foo()), fun>::value
     ));

to the end of libs/typeof/test/function_ref.cpp

The code written by Tobias fixes function_native and function_ref_native
tests on gcc 3.2.3 and 3.3.6. It doesn't break any test on gcc 3.4.4. On
gcc 4.0.3 and gcc 4.2.0, it fixes lvalue_native test. I haven't tried to
analyze why, though.

lvalue_native error report on gcc 4.0.2 can be found here:
http://tinyurl.com/7oemg

-- 
Alexander Nasonov

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