
John Maddock wrote:
I must be missing something. The trivial implementation of is_pointer: template<class T> struct is_pointer: mpl::false_ {}; template<class T> struct is_pointer<T*>: mpl::true_ {};
should work on everything except MSVC 6/7, right? So why isn't it being used?
Yeah, duh. Why not?
Lots of reasons, but as usual it's complex:
1) There are some compilers that bind member [function] pointers to foo<T*> partial specialisations, if I remember correctly, gcc was one, but don't quote me on that, and I don't know which behaviours are right and which wrong either. The fix was to check that a pointer was not a member pointer before actually declaring it a pointer.
I suspected something along those lines. Yes, some versions of g++ do that; some even allow you to delete a member pointer. No, it's not right. But why didn't you guard this in a BOOST_WORKAROUND specific to the particular g++ versions in question? (This is fixed in g++ 3.4 and above, I believe.)