Closed kammce closed 9 months ago
This was actually a bad idea. Destructors are okay. And its okay to have unknown behavior on destruction. It will limit certain potential applications of drivers. There may be some guarantees we can make about driver destructors that should apply across all devices.
hal::initialize<T>()
will statically allocate and construct in-place the object of choice and return anentity<T, storage_key_t>
object with a unique type signature which is used to differentiate each statically allocated object from each other. These entity objects can then be used like pointers to typeT
with full access to their underlying APIs, can be passed to other drivers to compose drivers, or be used withmake_interface()
functions to generate unique statically allocated adaptors for drivers.