Le 11/03/2016 06:10, Paul Fultz II a écrit :
We can define functions by simply composing other functions together and we don't need to write awkward syntax nor template boilerplate for it. For example, we can simply write `make_tuple` like this:
BOOST_FIT_STATIC_FUNCTION(make_tuple) = by(decay, constructstd::tuple()); What is the type of by(decay,constructstd::tuple()) ?
It is something like `by_adaptor
std::tuple>`. I thought I would be able to write locally:
auto make_tuple(by(decay,constructstd::tuple()));
but evidently you are saying that does not work.
That is not what I am saying at all. It can work, the functions can be used locally, like in the first example. However, for `make_tuple` this is not useful at all.
Let people consider what is useful or not. Naming the local functions could make the code more readable sometimes.
If `std::make_tuple` was assigned to a local variable then no one could ever call the function. So you use global function objects when you want to make the function available for consumption by others. And the advantage of defining `make_tuple` this way over writing it as it is written currently in the standard library, is that we can avoid all the template boilerplate involved with this. This is style question that should be out of the scope of the library. The library must show what can be done with it.
Vicente