3 ms·
The other major use-case is where other code constrains you, e.g. it's being passed as a callback to a C library. There are also a number of cases where passin
by amalcon 4y ago
The other major use-case is where other code constrains you, e.g. it's being passed as a callback to a C library.
There are also a number of cases where passing a pointer into a template function can be more concise. E.g. since pointers are iterators, if you have a generic function that iterates over things and you just want it to look at one thing (or zero) for testing, you can usually do this with pointer arithmetic.