coord: add general store template and 5-element init

This commit is contained in:
Danny Robson 2018-04-17 14:25:04 +10:00
parent f7a9dc598f
commit 0f9fb9b515
2 changed files with 20 additions and 0 deletions

View File

@ -71,6 +71,18 @@ namespace util::coord {
store<4,T,SelfT> ({ v0, v1, v2, v3 }) store<4,T,SelfT> ({ v0, v1, v2, v3 })
{ ; } { ; }
}; };
//-------------------------------------------------------------------------
template <typename T, typename SelfT>
struct init<5,T,SelfT> : public store<5,T,SelfT>
{
using store<5,T,SelfT>::store;
constexpr init () = default;
constexpr init (T v0, T v1, T v2, T v3, T v4):
store<5,T,SelfT> ({ v0, v1, v2, v3, v4 })
{ ; }
};
} }
#endif #endif

View File

@ -108,6 +108,14 @@ DEFINE_STORE(vector, x, y, z, w)
#undef DEFINE_STORE #undef DEFINE_STORE
namespace util::coord {
template <size_t S, typename T, typename SelfT>
struct store {
T data[S];
};
}
#if 0 #if 0
template <typename T> template <typename T>
struct util::coord::store<1,T,::util::extent<1,T>> { struct util::coord::store<1,T,::util::extent<1,T>> {