This is what I came up with, given your code:
static struct nullptr_t
{
template< typename t_type >
operator t_type* () { return 0; }
} nullptr;
One difference is that I made the nullptr object static so it could be placed in a header without linker conflicts. Your idea is great and simple, I like it. Thanks a lot.
>Would that works for you:
> Does boost have some sort of null_ptr class that allows you to do portable
> NULL comparisons?
struct nullptr_t
{
template<class T> operator T* () const { return 0; }
}nullptr;
?
_______________________________________________
Boost-users mailing list
Boost-users@lists.boost.org
http://lists.boost.org/mailman/listinfo.cgi/boost-users