Re: [Boost-bugs] [Boost C++ Libraries] #4540: fold<Sequence>() instantiates result_of::fold<Sequence const>

Subject: Re: [Boost-bugs] [Boost C++ Libraries] #4540: fold<Sequence>() instantiates result_of::fold<Sequence const>
From: Boost C++ Libraries (noreply_at_[hidden])
Date: 2010-08-13 18:40:10


#4540: fold<Sequence>() instantiates result_of::fold<Sequence const>
--------------------------------------+-------------------------------------
  Reporter: anonymous | Owner: djowel
      Type: Bugs | Status: new
 Milestone: Boost 1.44.0 | Component: fusion
   Version: Boost Development Trunk | Severity: Problem
Resolution: | Keywords:
--------------------------------------+-------------------------------------

Comment (by anonymous):

 I see.
 but I guess there is another solution, because the following works:

 {{{

 struct A{};

 template<typename T>
 struct fresult;

 template<>
 struct fresult<A>{
     typedef void type;
 };

 template<typename T>
 typename fresult<T>::type f(T &){}
 template<typename T>
 typename fresult<T const>::type f(T const &){}

 int main(){
     A a;
     f(a);
 }

 }}}

 the undefined fresult<T const> is not instantiated for the call to the
 non-const overload. I don't know what exactly causes the instantiation of
 result_of::fold<Seq const>, but this suggests there might a solution other
 than removing the const overload.

-- 
Ticket URL: <https://svn.boost.org/trac/boost/ticket/4540#comment:2>
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:04 UTC