Boost logo

Boost :

Subject: Re: [boost] [type_traits] possible regression on is_function trait
From: Vicente J. Botet Escriba (vicente.botet_at_[hidden])
Date: 2012-11-05 12:56:50


Le 05/11/12 18:26, Vicente J. Botet Escriba a écrit :
> Hi,
>
> I don't know if this is a regression on Boost.TypeTraits or if I'm
> using incorrectly the is_function trait.
>
> John, could you confirm there is a bug in is_function?
>
> Best,
> Vicente
>
> Test output: Sandia-darwin-4.4 - thread - async__async_p / darwin-4.4
> Rev 81191 / Mon, 5 Nov 2012 06:30:00 +0000
> *Report Time: *Mon, 5 Nov 2012 14:19:58 +0000
> Compile [2012-11-05 07:50:44 UTC]: fail
>
> "/opt/local/bin/g++-mp-4.4" -ftemplate-depth-128 -O0 -fno-inline
> -Wall -pedantic -g -dynamic -gdwarf-2 -fexceptions -fPIC -Wextra
> -Wno-long-long -fpermissive -pedantic -DBOOST_ALL_NO_LIB=1
> -DBOOST_CHRONO_DYN_LINK=1 -DBOOST_SYSTEM_DYN_LINK=1
> -DBOOST_SYSTEM_NO_DEPRECATED -DBOOST_THREAD_BUILD_DLL=1
> -DBOOST_THREAD_POSIX
> -DBOOST_THREAD_THROW_IF_PRECONDITION_NOT_SATISFIED
> -DBOOST_THREAD_USE_DLL=1 -I".." -c -o
> "/Volumes/scratch/kbelco/boost/results/boost/bin.v2/libs/thread/test/async__async_p.test/darwin-4.4/debug/threading-multi/sync/futures/async/async_pass.o"
> "../libs/thread/test/sync/futures/async/async_pass.cpp"
>
> In file included from ../boost/type_traits/is_convertible.hpp:28,
> from ../boost/thread/detail/move.hpp:13,
> from ../boost/thread/future.hpp:20,
> from
> ../libs/thread/test/sync/futures/async/async_pass.cpp:28:
> ../boost/type_traits/is_function.hpp: In instantiation of
> 'boost::detail::is_function_chooser<false>::result_<boost::rv<boost::rv<boost::packaged_task<int()>
> > >&>':
> ../boost/type_traits/is_function.hpp:60: instantiated from
> 'boost::detail::is_function_impl<boost::rv<boost::rv<boost::packaged_task<int()>
> > >&>'
> ../boost/type_traits/is_function.hpp:102: instantiated from
> 'boost::is_function<boost::rv<boost::rv<boost::packaged_task<int()> >
> >&>'
> ../boost/type_traits/is_convertible.hpp:354: instantiated from
> 'const bool
> boost::detail::is_convertible_impl<boost::rv<boost::packaged_task<int()>
> >&, boost::rv<boost::rv<boost::packaged_task<int()> > >&>::value'
> ../boost/type_traits/is_convertible.hpp:480: instantiated from
> 'boost::is_convertible<boost::rv<boost::packaged_task<int()> >&,
> boost::rv<boost::rv<boost::packaged_task<int()> > >&>'
> ../boost/thread/future.hpp:2717: instantiated from 'boost::future<T>
> boost::async(boost::launch, R (*)()) [with R = int]'
> ../libs/thread/test/sync/futures/async/async_pass.cpp:117:
> instantiated from here
> ../boost/type_traits/is_function.hpp:52: error: forming pointer to
> reference type 'boost::rv<boost::rv<boost::packaged_task<int()> > >&'
>
>
>
I don't know what is going wrong, but the instantiation seems to think
that boost::rv<boost::rv<boost::packaged_task<int()> > >& is not a
reference.

Could someone check this?

Thanks,
Vicente

template<bool is_ref = true>
struct is_function_chooser
     : public ::boost::type_traits::false_result
{
};

template <>
struct is_function_chooser<false>
{
     template< typename T > struct result_
         : public ::boost::type_traits::is_function_ptr_helper<T*>
     { //line 52
     };
};

template <typename T>
struct is_function_impl
     : public is_function_chooser< ::boost::is_reference<T>::value >
         ::BOOST_NESTED_TEMPLATE result_<T>
{ //line 60
};


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