Are there cases where a typedef is absolutely necessary?

Ah, I just remembered the identity meta-function. It is possible to write

operator typename identity<void (Testable::*)() const>::type() const;

with the following definition of identity:

template <typename T>
struct identity
{
    typedef T type;
};

You could argue that identity still uses a typedef, but this solution is “good” enough for me.

Leave a Comment

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)