Reputation: 10153
I have the following definition in file Segment.h
template<typename T, typename VecType = mat::vec3_gen<T> > class Segment
{
// class
}
Instead of having typename VecType = mat::vec3_gen<T>
I want to use some alias for the type
and be able to use it outside the file also. how can I do it?
Upvotes: 1
Views: 64
Reputation: 41770
Since the type VecType
depends on T
, you can make the type alias a member of Segment
.
template<typename T>
class Segment {
public:
using VecType = mat::vec3_gen<T>;
};
Now you can use it in other code:
auto vec = Segment<int>::VecType;
Upvotes: 4