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

Threaded View

  1. #2
    Join Date
    Jun 2010
    Posts
    85

    Re: Strange function overloading behavior with int and enum

    I have to admit when I first read this I thought you were smoking crack. Obviously the solution to your example is an Explicit cast, but I get your point. I have absolutly no idea why it behaves this way. I even modified the enum and assigned different values 10,20,30 so that there was no 0 "Bar" value and it still calls the Foo(Bar a) when 0 is used as a argument.

    Long and short of it, pretty darn interesting, I bet that was a b-word to debug.
    Last edited by [email protected]; June 30th, 2010 at 01:02 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