|
Boost-Commit : |
Subject: [Boost-commit] svn:boost r66240 - sandbox/function/boost/function
From: dsaritz_at_[hidden]
Date: 2010-10-28 15:21:18
Author: psiha
Date: 2010-10-28 15:21:17 EDT (Thu, 28 Oct 2010)
New Revision: 66240
URL: http://svn.boost.org/trac/boost/changeset/66240
Log:
Fixed function-pointer assignment compilation errors for GCC and Clang.
Text files modified:
sandbox/function/boost/function/function_base.hpp | 8 +++++---
sandbox/function/boost/function/function_template.hpp | 16 ++++++++--------
2 files changed, 13 insertions(+), 11 deletions(-)
Modified: sandbox/function/boost/function/function_base.hpp
==============================================================================
--- sandbox/function/boost/function/function_base.hpp (original)
+++ sandbox/function/boost/function/function_base.hpp 2010-10-28 15:21:17 EDT (Thu, 28 Oct 2010)
@@ -185,8 +185,8 @@
template <class Other>
bool operator==( fallocator<Other> const & ) const { return true; }
- template <typename T>
- static T * address( T & value ) { return boost::addressof( value ); }
+ template <typename TT>
+ static TT * address( TT & value ) { return boost::addressof( value ); }
pointer allocate ( size_type const count, void const * /*p_hint*/ ) { return allocate( count ); }
pointer allocate ( size_type const count ) { return static_cast<pointer>( ::operator new( count * sizeof( T ) ) ); }
@@ -405,7 +405,9 @@
template <typename F>
class get_function_tag
{
- typedef typename mpl::if_c<(is_pointer<F>::value || is_msvc_exception_specified_function_pointer<F>::value),
+ typedef typename mpl::if_c<(is_pointer<F>::value ||
+ is_function<F>::value ||
+ is_msvc_exception_specified_function_pointer<F>::value),
function_ptr_tag,
function_obj_tag>::type ptr_or_obj_tag;
Modified: sandbox/function/boost/function/function_template.hpp
==============================================================================
--- sandbox/function/boost/function/function_template.hpp (original)
+++ sandbox/function/boost/function/function_template.hpp 2010-10-28 15:21:17 EDT (Thu, 28 Oct 2010)
@@ -576,29 +576,29 @@
// ...direct actually means whether to skip pre-destruction (when not
// assigning but constructing) so it should probably be renamed to
// pre_destroy or the whole thing solved in some smarter way...
- template<bool direct, typename FunctionObj, typename Allocator>
+ template <bool direct, typename FunctionObj, typename Allocator>
void do_assign( FunctionObj const & f, Allocator const a )
{
typedef typename detail::function::get_function_tag<FunctionObj>::type tag;
dispatch_assign<direct, FunctionObj>( f, a, tag() );
}
- template<bool direct, typename FunctionObj>
+ template <bool direct, typename FunctionObj>
void do_assign( FunctionObj const & f ) { do_assign<direct>( f, detail::function::fallocator<FunctionObj>() ); }
- template<bool direct, typename FunctionObj, typename Allocator>
+ template <bool direct, typename FunctionObj, typename Allocator>
void dispatch_assign( FunctionObj const & f, Allocator const a, detail::function::function_obj_tag ) { do_assign<direct, FunctionObj>( f , f , a ); }
- template<bool direct, typename FunctionObj, typename Allocator>
- void dispatch_assign( FunctionObj const & f, Allocator const a, detail::function::function_ptr_tag ) { do_assign<direct, FunctionObj>( f , f , a ); }
+ template <bool direct, typename FunctionObj, typename Allocator> // This one has to be exactly as it is for GCC and Clang...:
+ void dispatch_assign( FunctionObj const f, Allocator const a, detail::function::function_ptr_tag ) { do_assign<direct >( f , f , a ); }
// DPG TBD: Add explicit support for member function
// objects, so we invoke through mem_fn() but we retain the
// right target_type() values.
- template<bool direct, typename FunctionObj, typename Allocator>
+ template <bool direct, typename FunctionObj, typename Allocator>
void dispatch_assign( FunctionObj const & f, Allocator const a, detail::function::member_ptr_tag ) { do_assign<direct, FunctionObj>( f , mem_fn( f ), a ); }
- template<bool direct, typename FunctionObj, typename Allocator>
+ template <bool direct, typename FunctionObj, typename Allocator>
void dispatch_assign( FunctionObj const & f, Allocator const a, detail::function::function_obj_ref_tag ) { do_assign<direct, typename FunctionObj::type>( f.get(), f , a ); }
- template<bool direct, typename ActualFunctor, typename StoredFunctor, typename ActualFunctorAllocator>
+ template <bool direct, typename ActualFunctor, typename StoredFunctor, typename ActualFunctorAllocator>
void do_assign( ActualFunctor const & original_functor, StoredFunctor const & stored_functor, ActualFunctorAllocator const a )
{
if
Boost-Commit list run by bdawes at acm.org, david.abrahams at rcn.com, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk