Subject: Re: [boost] [review][Fit] Review of Fit starts today : September 8 - September 17
From: P F (pfultz2_at_[hidden])
Date: 2017-09-16 18:14:01
> On Sep 15, 2017, at 8:46 PM, Edward Diener via Boost <boost_at_[hidden]> wrote:
> On 9/8/2017 7:02 AM, Matt Calabrese via Boost wrote:
>> A formal review of the Fit library developed by Paul Fultz II starts
>> today, September 8, and runs through September 17.
>> A branch has been made for the review. You can find Fit for review at
>> these links:
>> Source: https://github.com/pfultz2/Fit/tree/boost <https://github.com/pfultz2/Fit/tree/boost>
>> Docs: http://pfultz2.github.io/Fit/doc/html/doc/ <http://pfultz2.github.io/Fit/doc/html/doc/>
> I have some questions about Fit which I can not understand by reading the docs:
> 1) Does Fit functionality work only with function objects as opposed to callables in general ?
In general yes, but its not the case for every adaptor.
> 2) Is the purpose of BOOST_FIT_STATIC_FUNCTION only to create a function object at global or namespace level ?
> 3) Does BOOST_FIT_STATIC_FUNCTION only accept a function object or does it accept any callable ?
It only works with function objects, which I should document its type requirements.
> 4) The documentation says that "BOOST_FIT_STATIC_LAMBDA_FUNCTION can be used to the declare the lambda as a function". I am not sure what this actually means since a lambda function is a function.
Maybe that could be worded better, but it lets you declare the lambda at global or namespace scope.
> 5) I do not understand the purpose of the pipable adaptor. What is the point of using it ? It is mentioned as an alternative to Unified Call Syntax but, while I understand the latter, I do not understandable how pipable allows "extension methods", which is a large part of the purpose of UFCS.
That is, you want to add an extension method to a class so it can be called as `x.f(y)`. With UFCS, you can just declare a free function called as `f(x, y)` and then call it as `x.f(y)`, with the Fit library you would declare the function as pipable and then call it as `x | f(y)`.
> In general I am confused by what the requirements of Fit adaptors are.
> This may be because the terms "function objects" and "functions" are used in a way which does not follow standard C++ terminology as far as I know it.
The type requirements for the adaptors are documented as either `ConstCallable` or `ConstFunctionObject`, which follows standard C++ definitions with an additional `const` requirement.
Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk