Talk About Network



Register and Login
Nick
Password
Register create new account Sign up is FREE and you can post replies, new topics, bookmark posts and more!
Recover lost password


Programming > Codewarrior Windows > void* conversio...
Latest [ Topics | Posts ] Archive Post A New Topic Post a Reply
<< Topic < Post Post 1 of 5 Topic 254 of 318
Post > Topic >>

void* conversion yields ambiguity upon dereference

by "Jonathan Turkanis" <technews@[EMAIL PROTECTED] > Feb 13, 2005 at 03:24 PM

Hi,

Consider this program:

    struct Thing {
        operator void* () const;
    };

    struct any {
        template<class T>
        any(T const&);
    };

    char operator*(any const&);

    int main()
    {
        Thing t;
        *t;
    }

This compiles on VC7.1, GCC 3.4 and como 4.3.3.  I'm interested to know
the
result when compiled on CW 9.4, which I don;t have access to. Based on the
Boost
regression reports here, http://tinyurl.com/5wtud,
I am guessing the
compiler
will complain of an ambiguity between 'void operator*(any const&)' and
'operator* (void *)'.

I'm puzzled by this reference to 'operator* (void*)'. Since a void pointer
cannot be dereferenced, why should this dereferncing operation be
considered
during overload resolution?

Best Regards,
Jonathan




 5 Posts in Topic:
void* conversion yields ambiguity upon dereference
"Jonathan Turkanis&q  2005-02-13 15:24:26 
Re: void* conversion yields ambiguity upon dereference
MW Ron <mwron@[EMAIL P  2005-02-22 23:30:17 
Re: void* conversion yields ambiguity upon dereference
"Jonathan Turkanis&q  2005-02-22 21:58:25 
Re: void* conversion yields ambiguity upon dereference
MW Ron <mwron@[EMAIL P  2005-02-23 22:42:23 
Re: void* conversion yields ambiguity upon dereference
"Jonathan Turkanis&q  2005-02-23 21:59:25 

Post A Reply:
  Go here to Signup

AddThis Feed Button


About - Advertising - Contact - Frequently Asked Questions - Privacy Policy - Terms of Use - Signup

Contact
tan12V112 Wed May 14 13:12:20 CDT 2008.