9 #ifndef CUBBYFLOW_POINT_IMPL_H 10 #define CUBBYFLOW_POINT_IMPL_H 16 template <
typename T,
size_t N>
19 for (
auto& elem : m_elements)
21 elem =
static_cast<T
>(0);
25 template <
typename T,
size_t N>
26 template <
typename... Params>
29 static_assert(
sizeof...(params) == N,
"Invalid number of parameters.");
34 template <
typename T,
size_t N>
38 assert(list.size() >= N);
41 for (
const auto& inputElem : list)
43 m_elements[i] =
static_cast<T
>(inputElem);
48 template <
typename T,
size_t N>
50 m_elements(other.m_elements)
55 template <
typename T,
size_t N>
59 assert(list.size() >= N);
62 for (
const auto& inputElem : list)
64 m_elements[i] =
static_cast<T
>(inputElem);
69 template <
typename T,
size_t N>
72 m_elements = other.m_elements;
75 template <
typename T,
size_t N>
83 template <
typename T,
size_t N>
90 template <
typename T,
size_t N>
96 template <
typename T,
size_t N>
102 template <
typename T,
size_t N>
103 template <
typename... Params>
108 SetAt(i + 1, params...);
111 template <
typename T,
size_t N>
112 void Point<T, N>::SetAt(
size_t i, T v)
void Set(const std::initializer_list< U > &list)
Set point instance with initializer list.
Definition: Point-Impl.h:57
Generic N-D point class.
Definition: Point.h:24
Definition: pybind11Utils.h:24
Point & operator=(const std::initializer_list< U > &list)
Set point instance with initializer list.
const T & operator[](size_t i) const
Returns the const reference to the i -th element.
Definition: Point-Impl.h:91
Point()
Constructs a point with zeros.
Definition: Point-Impl.h:17