C++ Logo

sg14

Advanced search

[isocpp-sg14] Introducing `Embedded Function` - A Heap-Free Function Wrapper

From: ycjin_kim <ycjin_kim_at_[hidden]>
Date: Sat, 15 Aug 2026 15:21:51 +0800 (CST)
Hi SG14,


My name is Kim, a developer interested in embedded systems. I'd like to share a project I've been working on called "Embedded Function" and get the group's feedback.


**Project Introduction**
`Embedded Function` is a lightweight, header-only library that provides a collection of heap-free polymorphic function wrappers (like `ebd::fn`, `ebd::unique_fn`, `ebd::fn_ref`). It's designed for resource-constrained or high-performance environments like game development and embedded systems. The library is freestanding, supports C++11 through C++26, and offers several performance optimizations like branch elimination and zero-stack overhead. It contains only one header file, so it is Godbolt friendly.


**Why I'm sharing this with SG14**
I understand that SG14 has been interested in a non-allocating `inplace_function` for a long time. While the `stdext::inplace_function` implementation exists in the SG14 repository, it seems the standardization effort has not progressed recently. My library aims to be a modern, production-ready alternative. It offers several variants (`fn`, `unique_fn`, `classic_fn`, `fn_ref`) to cover different use cases, similar to what `std::function`, `std::copyable_function`, and `std::function_ref` provide.


I believe `Embedded Function` could serve as a valuable data point or even a potential reference implementation for any future standardization efforts in this area.


**Questions for the group**
- Does the direction of `Embedded Function` align with what SG14 envisions for a standard `inplace_function`?
- Are there any features or design choices you think are missing or could be improved?
- What would be the best way to contribute this work to the ongoing discussion?


The project is open-source on GitHub: https://github.com/Kim-J-Smith/Embedded-Function. I'd be very grateful for any feedback, suggestions, or criticism.


Best regards,
Kim J. Smith

Received on 2026-08-15 07:22:03