Re: [Boost-bugs] [Boost C++ Libraries] #9338: VS2005 compiler errors in swap() definition after including container/memory_util.hpp

Subject: Re: [Boost-bugs] [Boost C++ Libraries] #9338: VS2005 compiler errors in swap() definition after including container/memory_util.hpp
From: Boost C++ Libraries (noreply_at_[hidden])
Date: 2013-11-17 09:43:59


#9338: VS2005 compiler errors in swap() definition after including
container/memory_util.hpp
----------------------------------------+------------------------
  Reporter: Fedor Trushkin <ted-xp@…> | Owner: igaztanaga
      Type: Bugs | Status: new
 Milestone: To Be Determined | Component: container
   Version: Boost 1.54.0 | Severity: Problem
Resolution: | Keywords:
----------------------------------------+------------------------

Comment (by Fedor Trushkin <ted-xp@…>):

 Could you explain, please, why zero arguments case is handled specially? I
 modified it to use the same ideas an in funwrap and it seems acting
 perfectly without any compiler errors. That's how it looks like after
 preprocessing:

 {{{
          template<typename Fun>
          struct funwrap0_swap
             : Fun
          {
             funwrap0_swap();
             using Fun::swap;
 boost_intrusive_has_member_function_callable_with::private_type
                swap() const;
          };
          template<typename Fun>
          struct has_member_function_callable_with_swap_impl
             <Fun, true
             , void
>
          {
             typedef funwrap0_swap<Fun>
                      FunWrap;
             static bool const value =
 (sizeof(boost_intrusive_has_member_function_callable_with::no_type) ==
 sizeof(boost_intrusive_has_member_function_callable_with::is_private_type
                         ( (boost::move_detail::declval<FunWrap>().
                               swap(), 0
                            )
                         )
                      )
             );
          };
 }}}

 For me the only worrying thing is {{{using std::swap}}} statement, as I
 don't get how exactly should this be regarded by compiler if no swap is
 available in {{{Fun}}} base class.

-- 
Ticket URL: <https://svn.boost.org/trac/boost/ticket/9338#comment:3>
Boost C++ Libraries <http://www.boost.org/>
Boost provides free peer-reviewed portable C++ source libraries.

This archive was generated by hypermail 2.1.7 : 2017-02-16 18:50:14 UTC