C++ Logo

std-proposals

Advanced search

Re: [std-proposals] std::constant_size_function

From: Frederick Virchanza Gotham <cauldwell.thomas_at_[hidden]>
Date: Sat, 15 Jun 2024 22:46:20 +0100
On Fri, Jun 14, 2024 at 11:04 AM Frederick Virchanza Gotham wrote:
>
> But what if we had a new template class called
> 'std::constant_size_function' which we would use as follows.


I have patched libstdc++ to make this possible, and I did it in 3 steps.

Step 1 - Introduce 3 new template parameters

    https://github.com/healytpk/versatile_function/commit/7ac083eab3178ff57030f164de84e16779d2dc43

Step 2 - Change std::function to std::versatile::function

    https://github.com/healytpk/versatile_function/commit/fafe84a63fa1602dc7262021384a0ae334ea5b6f

Step 3 - New class std::constant_size_function

    https://github.com/healytpk/versatile_function/commit/ea4d44bcdad089bc8106220f7cd49a863d27c620

You can test it out up on GodBolt here:

    https://godbolt.org/z/ecY7PMsMc

Received on 2024-06-15 21:46:34