4 ms·
> I would like array_get to return a const pointer if the input was a const pointer, and a full pointer otherwise Pointers (and other types) don't have "const-
by zabzonk 5y ago
> I would like array_get to return a const pointer if the input was a const pointer, and a full pointer otherwise
Pointers (and other types) don't have "const-ness" attached to them - it's entirely dependent on the declaration of the function. Also, in C++ you can't overload on function return types.