cpetig / wit-bindgen

A (C++) language binding generator for WebAssembly interface types
Apache License 2.0
5 stars 3 forks source link

Shallow vs deep ownership #23

Open cpetig opened 6 months ago

cpetig commented 6 months ago

For passing as a reference std::vector<std::string> const&and std::vector<std::string_view> const& (and less so std::vector<std::string_view>) make sense.

Which one to choose? I tend towards the first.

This gets more prominent with resources!

cpetig commented 6 months ago

But std::vector<std::string_view> is your only option if you don't have a vector already containing the objects.

cpetig commented 6 months ago

this is exactly the purpose of the --ownership parameter for Rust