Open main menu
Home
Random
Recent changes
Special pages
Community portal
Preferences
About Wikipedia
Disclaimers
Incubator escapee wiki
Search
User menu
Talk
Dark mode
Contributions
Create account
Log in
Editing
Double dispatch
(section)
Warning:
You are not logged in. Your IP address will be publicly visible if you make any edits. If you
log in
or
create an account
, your edits will be attributed to your username, along with other benefits.
Anti-spam check. Do
not
fill this in!
===C#=== In [[C Sharp (programming language)|C#]], when calling an instance method accepting an argument, multiple dispatch can be achieved without employing the visitor pattern. This is done by using traditional polymorphism while also casting the argument to ''dynamic''.<ref>{{cite web |url=https://msdn.microsoft.com/en-us/library/dd264736.aspx |title=Using Type dynamic (C# Programming Guide) |publisher=Microsoft |date=30 Sep 2009 |website=Microsoft Developer Network |access-date=25 May 2016 |quote=... Overload resolution occurs at run time instead of at compile time if one or more of the arguments in a method call have the type dynamic ...}}</ref> The run-time binder will choose the appropriate method overload at run-time. This decision will take into consideration the run-time type of the object instance (polymorphism) as well as the run-time type of the argument.
Edit summary
(Briefly describe your changes)
By publishing changes, you agree to the
Terms of Use
, and you irrevocably agree to release your contribution under the
CC BY-SA 4.0 License
and the
GFDL
. You agree that a hyperlink or URL is sufficient attribution under the Creative Commons license.
Cancel
Editing help
(opens in new window)