templates

warning: Creating default object from empty value in /mnt/web005/a1/00/51694400/htdocs/bwy/public_html/sites/all/modules/i18n/i18ntaxonomy/i18ntaxonomy.pages.inc on line 34.

Pointers and recursive templates

How do you get the 'pointed-to' type in C++?

template<typename T>
struct RemovePointer
{
    typedef T value_type;
};

template<typename T>
struct RemovePointer<T*>
{
    typedef typename RemovePointer<T>::value_type value_type;
};

What's the point? With a bit of boost magic, you can use pointers transparently in generic code:

Syndicate content