DynamicLibrary: Copyable?


#1

In theory it should be possible to make DynamicLibrary copyable on all platforms, just duplicate the shared library handle (at least, on Windows this works).

Then we could use a DynamicLibrary object more conveniently in containers: e.g. Array or, God forbid, std::vector (yuck!)


#2

Is this a bad idea?


#3

No, not a bad idea per se, but it seems a little superfluous to me… If you need to share multiple references to a DynamicLibrary, you could always just use a std::shared_ptr to it, which would be more efficient than using OS-level calls to maintain its ref count.