Boost logo

Boost :

From: Joel de Guzman (joel_at_[hidden])
Date: 2003-10-09 12:54:04


David Abrahams <dave_at_[hidden]> wrote:
> Douglas Gregor <gregod_at_[hidden]> writes:

>> We've discussed this before, although I can't find a reference to it because
>> I believe it was an e-mail conversation. The reason we did not name the
>> "result" member class template "apply" is that we envisioned function object
>> types that were both metafunction classes and function objects, and therefore
>> would have both "apply" (in the MPL sense) and "result" (in the result_of
>> sense) member class templates. For instance:
>>
>> struct find_
>> {
>> // Metafunction class
>> template<typename Sequence, typename MetaFunction>
>> struct apply
>> { typedef <MPL find algorithm result> type; }
>>
>> // Function object
>> template<typename FunctionCall> struct result;
>>
>> template<typename F, typename InputIterator, typename T>
>> struct result<F(InputIterator, InputIterator, T)>
>> { typedef InputIterator type; };
>>
>> template<typename InputIterator, typename T>
>> inline InputIterator
>> operator()(InputIterator first, InputIterator last, const T& x)
>> { return <standard library's find() algorithm result>; }
>> } find;
>>
>> Perhaps I'm sticking words in everyone's mouth, but I had thought that we
>> agreed on this. I believe "we" included (at least): Joel, Dave A. Jaakko, and
>> Aleksey.
>
> Yeah, sounds familiar.

Yeah, I remember now. I'm glad you had the paper as reminder ;-)
I just couldn't remember the rationale. Perhaps it should be written
somewher in the paper. Thanks for reminding us!

Regards,

-- 
Joel de Guzman
http://www.boost-consulting.com
http://spirit.sf.net

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