Boost logo

Boost Users :

From: Ray Hilton (RayHilton_64_at_[hidden])
Date: 2004-12-22 16:48:54


Something along theese lines
#include <boost\type_traits.hpp>

#define BOOST_REMOVE_POINTER(arg) \
namespace boost \
{ \
template <> \
struct remove_pointer<arg*> \
{ \
 typedef arg type; \
}; \
} // end namespace boost

user file

struct abc
{
    object x;
    object b;
};
BOOST_REMOVE_POINTER(abc)

boosts remove_pointer<T> will now work as expected for abc types

Do such macros already exist in boost?
Such macros can also be used on good compilers* to describe traits that it
can't figure out, such as has_nothrow_assign<T>

* compilers supporting partial template specialization


Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net