Generic methods and method overloading

前端 未结 6 1194
情歌与酒
情歌与酒 2020-11-29 09:30

Method overloading allows us to define many methods with the same name but with a different set of parameters ( thus with the same name but different signature ).

A

6条回答
  •  独厮守ぢ
    2020-11-29 09:45

    Yes, they are overloaded. The compiler is supposed to prefer explicit method signatures against generic methods if they are available. Beware, however, that if you can avoid this kind of overload you probably should. There have been bug reports with respect to this sort of overload and unexpected behaviors.

    https://connect.microsoft.com/VisualStudio/feedback/details/522202/c-3-0-generic-overload-call-resolution-from-within-generic-function

提交回复
热议问题