The C++ API has wrapper types with lots of custom / disabled copy operations / destructors for the opaque C API handles.
With C++11, it's possible to store the handles in shared_ptrs with custom deleters, so copying, moving and destroying objects is all handled by the compiler.
Another benefit is that handing out raw handles (see #105) is perfectly safe:
shared_ptr<lsl_struct_outlet_> raw_handle = stream_outlet(…).get_raw_handle();
// the stream outlet goes out of scope
lsl_push_foo(raw_handle.get());
// the handle to the outlet is still valid, until raw_handle goes out of scope, too.
The C++ API has wrapper types with lots of custom / disabled copy operations / destructors for the opaque C API handles. With C++11, it's possible to store the handles in
shared_ptr
s with custom deleters, so copying, moving and destroying objects is all handled by the compiler.Another benefit is that handing out raw handles (see #105) is perfectly safe: