ASPN ActiveState Programmer Network
ActiveState
/ Home / Perl / PHP / Python / Tcl / XSLT /
/ Safari / My ASPN /
Cookbooks | Documentation | Mailing Lists | Modules | News Feeds | Products | User Groups


Recent Messages
List Archives
About the List
List Leaders
Subscription Options

View Subscriptions
Help

View by Topic
ActiveState
.NET Framework
Open Source
Perl
PHP
Python
Tcl
Web Services
XML & XSLT

View by Category
Database
General
SOAP
System Administration
Tools
User Interfaces
Web Programming
XML Programming


MyASPN >> Mail Archive >> boost
boost
Re: [boost] null
by Eric Niebler other posts by this author
Jul 28 2005 6:22PM messages near this date
Re: [boost] null | Re: [boost] null
SOURCE Eric Niebler wrote:
>  Jason Hise wrote:
>  
> >Martin Wille wrote:
> >
> >>Jason Hise wrote:
> >>
> >>>undef NULL
> >>>#define NULL (::boost::null)
> >>>  
> >
> >What existing code will it break?
>  
>  
>  struct foo {};
>  typedef void (foo::*memfunptr)();
>  memfunptr p = NULL;


Bad example. This is OK, somewhat surprisingly (to me, at least). But 
consider:

struct foo { foo(void*) {} };
void bar(foo f) {}
void baz() {
   bar(NULL);
}

Works with NULL as 0, fails with NULL as null because it needs two 
user-defined conversions.

>  Redefining NULL is a career-limiting move. Don't do it.

This is still correct, though.

-- 
Eric Niebler
Boost Consulting
www.boost-consulting.com
_______________________________________________
Unsubscribe & other changes: http://lists.boost.org/mailman/listinfo.cgi/boost
Thread:
Jason Hise
Martin Wille
Jason Hise
Martin Wille
Eric Niebler
Eric Niebler
Jason Hise

Privacy Policy | Email Opt-out | Feedback | Syndication
© ActiveState Software Inc. All rights reserved