2 ms·
The optionals / non_null won't play well with external libraries though, right? As in, if I have to interface with a third party library taking plain pointers,
by viraptor 7y ago
The optionals / non_null won't play well with external libraries though, right? As in, if I have to interface with a third party library taking plain pointers, I would have to either unwrap on every usage, or create an extra interface in between which unpacks the arguments and wraps the result - or did I miss some better solution?
- einpoklum 7y ago> won't play well with external libraries though, right? 1. Library use boundaries are indeed a place where you often need to "unpack" more complex types. But then - external library APIs do tell you whether they take ownership of pointers and generally what you can expect from them. And it's not so bad to write lib_foo_function(my_unique_ptr.release(), other, args); instead of my_function(std::move(my_unique_ptr), other, args); 2. Libraries slowly adopt features of language standards, and typically lag behind. To be honest, though - this is going slower than I would have liked or expected.