ext_21139 ([identity profile] spamsink.livejournal.com) wrote in [personal profile] juan_gandhi 2007-02-13 04:22 am (UTC)

Вот так, к примеру:

template < typename T> 
struct arrdef
{
    typedef T type;
    static const std::size_t size = 0;
};

// If X happens to be an array type, e.g. typedef Y X[K];
// arrdef< X>::type == Y, arrdef< X>::size == K
template < typename T, std::size_t N> 
struct arrdef< T[N]>
{
    typedef T type;
    static const std::size_t size = N;
};

Post a comment in response:

This account has disabled anonymous posting.
If you don't have an account you can create one now.
HTML doesn't work in the subject.
More info about formatting