C++ Logo


Advanced search

Re: [isocpp-lib] std::function

From: Arthur O'Dwyer <arthur.j.odwyer_at_[hidden]>
Date: Tue, 20 Sep 2022 12:19:13 -0400
On Tue, Sep 20, 2022 at 9:22 AM Bjarne Stroustrup via Lib <
lib_at_[hidden]> wrote:

> I thought we had a variant of std::function that didn't allocate on free
> store for simple functions; it didn't make it for C++20? Is it still in
> process? and if so where would I look for the current state of the
> proposal.

[cc: SG14]
SG14 has implemented, and I maintain, a type-erased
`stdext::inplace_function<void(), Capacity, Align>` based on an informal
proposal by Carl Cook in 2016:

It has never had a P-numbered proposal, and the area hasn't seen any
movement that I'm aware of since circa 2018.

https://github.com/WG21-SG14/SG14/issues/125 inspired the implicit-move
changes in C++20 (P1155 More Implicit Move).
https://github.com/WG21-SG14/SG14/issues/150 is still an important
practical issue, where I happen to believe that the STL has chosen the
wrong default as usual, and why I stopped caring much about the
introduction of new type-erased types into the STL and started evangelizing
type erasure *as a technique* so that people can just write their own.
is related.


Received on 2022-09-20 16:19:27