I want to create an alias arr for std::array<T, 32>.
template<typename T>
using arr = std::array<T, 32>;
However, it does not work on GCC 4.4.6 which supports only C++0x(without type alias).
I think it is a very bad idea to use GCC 4.4.6 now, however, I want to know if there are some ways to simulate type alias.
The following code may work, but arr is not precisely std::array<T, 32>, so I want a better solution.
template<typename T>
struct arr : public std::array<T, 32>;
Before alias templates were a thing, it was common to write this instead:
template<typename T>
struct arr {
    typedef std::array<T, 32> type;
};
Instead of arr<T> you would have to use arr<T>::type and typename arr<T>::type when T is a template parameter.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With