explicit null param
is there a way to specify an explicit overload for
null
?
eg
foo(object_a); // object overload
foo(null); // null overload
eg, equivilant to C++'s std::nullptr_t
specifically to avoid
5 Replies
You can't have an overload specifically for null, although you can have an overload without the parameter entirely.
rip
Why would you want this anyway?
could i use
IntPtr
as an overload for null ?
for this
Rename
SetChildValueNull
to SetChildValue
, and just don't pass anything to it. If you need to check for null at runtime instead, then you'll need to do it in every function.