Hacker News new | ask | show | jobs
by shultays 493 days ago
What are the examples to std functions that uses a raw pointer but does not borrow/expects pointer to be valid past the function call?
1 comments

The fact that you have to ask that question makes GP's point. There's no way to tell that from looking at a function's interface at present.
Why? If all standard functions that take no ownership/keep references are using raw pointers then it behaves same as user code/C++ devs expect: if a function is taking a pointer then it claims no ownership. You take a look at standard_function(T*) and see raw pointer and then can assume it is not taking ownership or keeping references
The fact that you don't have an answer make's GP's point. This isn't actually a problem with the standard library because the semantics are clear.