~/talk

2024 Update: Efficient and Reliable Wrapping of C APIs Using Modern C++

Talkat ACCU 2024 · 2024-04-17..04-20· [c-and-cpp]
links:none on file
slides:none on file

Practical recipe for wrapping LMDB shows concrete techniques: use std::expected and std::span plus C++20/23 concepts to push errors and flags to compile time, bind readonly/open flags into distinct types so mutating methods disappear, manage C resources with RAII via unique_ptr with custom deleter and out_ptr helpers, and expose cursors as input iterators/ranges (exceptions required for error propagation). Tests use either link-time injection or compile-time proxy mocks; runtime overhead stays minimal because there is no dynamic dispatch or extra allocations.

AI-written summary · about

  1. 0:00C API wrapping intro
  2. 6:52Why wrap C APIs
  3. 12:50Error handling in wrappers
  4. 22:50RAII for resources
  5. 28:11Compile-time wrapper config
  6. 35:18Adapting C++ to C APIs
  7. 46:27Advanced wrapper techniques
  8. 57:13Iterators for C API data
  9. 1:02:33Testing wrapper strategies
  10. 1:15:11Summary
~/search
type to search 6,249 conferences, 138,987 speakers and 185,172 talks
~/help
cmdctrl k
search every conference, speaker and series
/
focus the filter search
h
home
c
conferences
s
speakers
e
series
t
light / dark — the status bar button does the same
?
this help
esc
close this, then clear every filter — or just the search, while you are typing in it

Ignored while you are typing. Pages without a filter rail have no search to focus.