You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This was feedback I received from Louis Dionne during the SG14 meeting at CppCon.
The idea is that with Folly (being a unique function), there might actually be lots of use cases of different storage types (and other behaviours), and then we will get an explosion of new types (e.g. std function, move-only function, inplace function). Maybe it is best to do what std::basic_string does, where Traits are used to provide the implementation details.
So basically the standard focuses on basic_function, and then inplace function is a second proposal that builds on basic function, providing traits where memory allocation is inplace.
The text was updated successfully, but these errors were encountered:
You can also control what gets in the vtable (and how the vtable is implemented), which solves the problem for unique_function at the same time (just don’t use dyno::CopyConstructible).
Today I played around with a basic_any that would enable creating specializations such as
using any = basic_any<32, alignof(std::max_align_t), std::allocator<void>>;
template<size_t Size, size_t Align>
using inplace_any = basic_any<Size, Align, inplace_allocator<void>>;
template<size_t Size, size_t Align>
using constexpr_any = basic_any<0, 0, constexpr_allocator<void>>;
You can find my current code here. The constexpr stuff still doesn't quite work; but I think that maybe it can be made to work if I just roll back the m_behaviors function optimization and go with plain old base-class-and-vtable type erasure.
This was feedback I received from Louis Dionne during the SG14 meeting at CppCon.
The idea is that with Folly (being a unique function), there might actually be lots of use cases of different storage types (and other behaviours), and then we will get an explosion of new types (e.g. std function, move-only function, inplace function). Maybe it is best to do what std::basic_string does, where Traits are used to provide the implementation details.
So basically the standard focuses on basic_function, and then inplace function is a second proposal that builds on basic function, providing traits where memory allocation is inplace.
The text was updated successfully, but these errors were encountered: