2015-03-06 01:46:01 +11:00
|
|
|
/*
|
2018-08-04 15:14:06 +10:00
|
|
|
* This Source Code Form is subject to the terms of the Mozilla Public
|
|
|
|
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
|
|
|
* file, You can obtain one at http://mozilla.org/MPL/2.0/.
|
2015-03-06 01:46:01 +11:00
|
|
|
*
|
|
|
|
* Copyright 2015 Danny Robson <danny@nerdcruft.net>
|
|
|
|
*/
|
|
|
|
|
2017-08-28 12:25:23 +10:00
|
|
|
#ifndef CRUFT_UTIL_COORD_INIT_HPP
|
|
|
|
#define CRUFT_UTIL_COORD_INIT_HPP
|
2015-03-06 01:46:01 +11:00
|
|
|
|
|
|
|
#include "store.hpp"
|
|
|
|
|
2017-08-28 12:25:23 +10:00
|
|
|
#include <cstddef>
|
2015-03-06 01:46:01 +11:00
|
|
|
|
2018-08-05 14:42:02 +10:00
|
|
|
namespace cruft::coord {
|
2017-11-22 17:03:00 +11:00
|
|
|
template <size_t S, typename T, typename SelfT>
|
2015-03-06 01:46:01 +11:00
|
|
|
struct init;
|
|
|
|
|
|
|
|
//-------------------------------------------------------------------------
|
2017-11-22 17:03:00 +11:00
|
|
|
template <typename T, typename SelfT>
|
|
|
|
struct init<1,T,SelfT> : public store<1,T,SelfT>
|
2015-03-06 01:46:01 +11:00
|
|
|
{
|
2017-11-22 17:03:00 +11:00
|
|
|
using store<1,T,SelfT>::store;
|
2015-07-21 01:38:36 +10:00
|
|
|
constexpr init () = default;
|
|
|
|
constexpr init (T v0):
|
2017-11-22 17:03:00 +11:00
|
|
|
store<1,T,SelfT> ({v0})
|
2015-03-06 01:46:01 +11:00
|
|
|
{ ; }
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
//-------------------------------------------------------------------------
|
2017-11-22 17:03:00 +11:00
|
|
|
template <typename T, typename SelfT>
|
|
|
|
struct init<2,T,SelfT> : public store<2,T,SelfT>
|
2015-03-06 01:46:01 +11:00
|
|
|
{
|
2017-11-22 17:03:00 +11:00
|
|
|
using store<2,T,SelfT>::store;
|
2015-07-21 01:38:36 +10:00
|
|
|
constexpr init () = default;
|
|
|
|
constexpr init (T v0, T v1):
|
2017-11-22 17:03:00 +11:00
|
|
|
store<2,T,SelfT> ({ v0, v1 })
|
2015-03-06 01:46:01 +11:00
|
|
|
{ ; }
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
//-------------------------------------------------------------------------
|
2017-11-22 17:03:00 +11:00
|
|
|
template <typename T, typename SelfT>
|
|
|
|
struct init<3,T,SelfT> : public store<3,T,SelfT>
|
2015-03-06 01:46:01 +11:00
|
|
|
{
|
2017-11-22 17:03:00 +11:00
|
|
|
using store<3,T,SelfT>::store;
|
2015-07-21 01:38:36 +10:00
|
|
|
constexpr init () = default;
|
|
|
|
constexpr init (T v0, T v1, T v2):
|
2017-11-22 17:03:00 +11:00
|
|
|
store<3,T,SelfT> ({v0, v1, v2})
|
2015-03-06 01:46:01 +11:00
|
|
|
{ ; }
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
//-------------------------------------------------------------------------
|
2017-11-22 17:03:00 +11:00
|
|
|
template <typename T, typename SelfT>
|
|
|
|
struct init<4,T,SelfT> : public store<4,T,SelfT>
|
2015-03-06 01:46:01 +11:00
|
|
|
{
|
2017-11-22 17:03:00 +11:00
|
|
|
using store<4,T,SelfT>::store;
|
2015-07-21 01:38:36 +10:00
|
|
|
constexpr init () = default;
|
|
|
|
constexpr init (T v0, T v1, T v2, T v3):
|
2017-11-22 17:03:00 +11:00
|
|
|
store<4,T,SelfT> ({ v0, v1, v2, v3 })
|
2015-03-06 01:46:01 +11:00
|
|
|
{ ; }
|
|
|
|
};
|
2018-04-17 14:25:04 +10:00
|
|
|
|
|
|
|
|
|
|
|
//-------------------------------------------------------------------------
|
|
|
|
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 })
|
|
|
|
{ ; }
|
|
|
|
};
|
2017-01-05 15:06:49 +11:00
|
|
|
}
|
2015-03-06 01:46:01 +11:00
|
|
|
|
|
|
|
#endif
|