Embedded Function v2.4.1
🔧 Fixed Bugs
- Fixed a bug where
ebd::make_fn(std::cw<...>, obj)failed to compile whenobjwas move-only; it now returnsebd::unique_fn. (#170) - Fixed a bug where
ebd::make_fn(std::cw<...>, obj)could not deduce the correctconst-qualifier of the signature. (#170) - Fixed an internal macro hygiene issue where
EMBED_DETAIL_STATIC_CALL_INVOKER_IMPLwas left defined after use; it is now undefined together with the other internal invoker macros. (#171)
ebd::make_fn(std::cw<NTTP-Callable>, obj)andebd::make_fn<...>(std::cw<NTTP-Callable>, obj)now deduce aconst-qualified signature when the first parameter of theNTTP-Callableis not a reference type. For example, for astd::cwof anint(*)(int, int)function, the deduced signature changed fromint(int)toint(int) constbecause the first parameterintis not a reference type. The qualifiers of the object type are preserved only when the first parameter of the callable is a reference type. (#170)
✨ New Features
- Owning polymorphic function wrappers (
ebd::fn,ebd::unique_fn,ebd::classic_fn) can now be constructed from{std::cw<...>, std::in_place_type<T>, CArgs...}and{std::cw<...>, std::in_place_type<T>, {std::initializer_list}, CArgs...}since C++26, as an experimental exploration of P2511: Beyond operator(): NTTP callables in type-erased call wrappers. The object is constructed in place inside the wrapper buffer and binds to the first parameter of the callable. (#170) - Added
ebd::make_fn(std::cw<...>, std::in_place_type<T>, CArgs...)andebd::make_fn(std::cw<...>, std::in_place_type<T>, std::initializer_list<U>, CArgs...), which deduce the wrapper type, the signature, the buffer size and the alignment. Both returnebd::fn, orebd::unique_fnwhen the object is not copy-constructible. (#170)
🛠️ Optimizations and Improvements
- Unified the template parameter naming and the documentation comments of the
std::constant_wrappersupport, and corrected the@returndocumentation of theebd::make_fnoverloads. (#170) - Switched the MSVC CI tests to the Ninja generator (
test/script/test-msvc.bat), which speeds up the CI test builds. (#172)
📌 Notes
operator boolstill works but may warn. It will be removed in a future release.- The
std::constant_wrapper+std::in_place_type_tsupport is still experimental.