Skip to content

Commit

Permalink
Add note about RVO in cpp.md
Browse files Browse the repository at this point in the history
`bindgen`'s inability to currently support RVO should be noted in C++ bindings generation document.
  • Loading branch information
aapoalas authored and emilio committed Dec 6, 2021
1 parent b1af6a4 commit 421e0ee
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions book/src/cpp.md
Original file line number Diff line number Diff line change
Expand Up @@ -71,3 +71,8 @@ cannot translate into Rust:
generate undefined behaviour. See
[the tracking issue for exceptions](https://github.com/rust-lang/rust-bindgen/issues/1208)
for more details.

* Return value optimization. C++ compilers will in certain circumstances optimize functions
returning a struct type value to instead take an extra hidden argument that refers
to the return value struct. `bindgen` cannot necessarily know about this optimization and
thus at present `bindgen`-interfaces for these kinds of functions are invalid.

0 comments on commit 421e0ee

Please sign in to comment.