ChangeTag for vec and construct from std::array
This commit is contained in:
@@ -44,6 +44,8 @@ public:
|
||||
requires(std::same_as<ArgsT, T> && ...) && (sizeof...(ArgsT) == N)
|
||||
vec(ArgsT... args) : m_Array{args...} {}
|
||||
|
||||
vec(std::array<T, N> array) : m_Array{array} {}
|
||||
|
||||
//
|
||||
// Access to elements & data
|
||||
//
|
||||
@@ -257,6 +259,12 @@ public:
|
||||
return m_Array[2];
|
||||
}
|
||||
|
||||
template <typename TargetTag>
|
||||
vec<T,N,TargetTag> ChangeTag()
|
||||
{
|
||||
return vec<T,N,TargetTag>(m_Array);
|
||||
}
|
||||
|
||||
private:
|
||||
std::array<T, N> m_Array;
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user