--- Begin Message ---
"Sergey P. Derevyago" <[EMAIL PROTECTED]> wrote:
 > Is the following code well-formed?
 > -----------------------------------8<-----------------------------------
 >  #include <stdio.h>
 >
 >  struct B {};
 >  struct D : private B {};
 >
 >  struct No {};
 >  struct Yes { No no[2]; };
 >
 >  Yes Test(B*);
 >  No Test(...);
 >
 >  int main()
 >  {
 >   printf("%d", sizeof(Test((D*)0))==sizeof(Yes));
 >  }
 > -----------------------------------8<-----------------------------------
 > It seems like it should not but some compilers don't agree.

You're right: This is an error.  The first "Test" is selected
by overload resolution, but trying to bind (D*)0 to the
parameter results in an access error.

SFINAE doesn't come into play here.

         Daveed

      [ Send an empty e-mail to [EMAIL PROTECTED] for info ]
      [ about comp.lang.c++.moderated. First time posters: do this! ]
--- End Message ---

-- 
                       David Abrahams
   [EMAIL PROTECTED] * http://www.boost-consulting.com
Boost support, enhancements, training, and commercial distribution
_______________________________________________
Unsubscribe & other changes: http://lists.boost.org/mailman/listinfo.cgi/boost

Reply via email to