Conversion between CAPI and C++

TODO: port article from sandbox on implicit/explicit conversion


There are c++ mapping for hid_t id-s which reference objects with std::shared_ptr type of behaviour with HDF5 CAPI internal reference counting. For further details see H5inc_ref, H5dec_ref and H5get_ref. The internal representation of these objects is binary compatible of the CAPI hid_t and interchangeable depending on the conversion policy: H5_some_function( static_cast<hid_t>( h5::hid_t id ), ... ) Direct initialization h5::ds_t{ some_hid } bypasses reference counting, and is intended to for use case where you have to take ownership of a CAPI hid_t object reference. This is equivalent behaviour to std::shared_ptr, when object destroyed reference count is decreased.

h5::ds_t ds = h5::open( ... );