3 ms·
Oh, is that new? I remember this biting me when I wanted to write a function that would interpret the value I passed to it, and have a special case for null po
by tiglionabbit 10y ago
Oh, is that new?
I remember this biting me when I wanted to write a function that would interpret the value I passed to it, and have a special case for null pointers. I wanted to also be able to pass a non-pointer to this same function name and get the standard case, but the dispatch would not let me do this unless I gave both versions of the function different names.
- weberc2 10y agoThe gotcha is usually when you're trying to use that type to satisfy an interface. If the methods that satisfy an interface are defined on a pointer, then you need to pass a pointer and not a value.