CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 8 of 8

Threaded View

  1. #4
    Join Date
    Jun 2010
    Posts
    85

    Re: Strange function overloading behavior with int and enum

    Quote Originally Posted by BigEd781 View Post
    enum derives implicitly from int, so of course the int version will be called instead of the object version because it is more restrictive.
    I can argue why it would call foo(Bar) or foo(object) with equal enthusiasm, but what does not make any sense is why It calls foo(bar) when the calling foo(0) and then calls foo(object) with foo(1)
    Last edited by [email protected]; June 30th, 2010 at 03:13 PM.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured