@@ -53,56 +53,11 @@ namespace Langulus::Math
5353 : mMin {min}
5454 , mMax {max} {}
5555
56- # if LANGULUS_SIMD(128BIT)
56+ // / Create from registers
5757 TEMPLATE () LANGULUS(INLINED)
58- TME()::TRange(const simde__m128 & source) noexcept {
58+ TME ()::TRange(const CT::SIMD auto & source) noexcept {
5959 SIMD::Store (source, mArray );
6060 }
61-
62- TEMPLATE () LANGULUS(INLINED)
63- TME()::TRange(const simde__m128d& source) noexcept {
64- SIMD::Store (source, mArray );
65- }
66-
67- TEMPLATE () LANGULUS(INLINED)
68- TME()::TRange(const simde__m128i& source) noexcept {
69- SIMD::Store (source, mArray );
70- }
71- #endif
72-
73- #if LANGULUS_SIMD(256BIT)
74- TEMPLATE () LANGULUS(INLINED)
75- TME()::TRange(const simde__m256& source) noexcept {
76- SIMD::Store (source, mArray );
77- }
78-
79- TEMPLATE () LANGULUS(INLINED)
80- TME()::TRange(const simde__m256d& source) noexcept {
81- SIMD::Store (source, mArray );
82- }
83-
84- TEMPLATE () LANGULUS(INLINED)
85- TME()::TRange(const simde__m256i& source) noexcept {
86- SIMD::Store (source, mArray );
87- }
88- #endif
89-
90- #if LANGULUS_SIMD(512BIT)
91- TEMPLATE () LANGULUS(INLINED)
92- TME()::TRange(const simde__m512& source) noexcept {
93- SIMD::Store (source, mArray );
94- }
95-
96- TEMPLATE () LANGULUS(INLINED)
97- TME()::TRange(const simde__m512d& source) noexcept {
98- SIMD::Store (source, mArray );
99- }
100-
101- TEMPLATE () LANGULUS(INLINED)
102- TME()::TRange(const simde__m512i& source) noexcept {
103- SIMD::Store (source, mArray );
104- }
105- #endif
10661
10762 // / Construct from a descriptor
10863 // / @param describe - the descriptor to scan
@@ -145,32 +100,30 @@ namespace Langulus::Math
145100 // / @param r - the range to copy
146101 // / @return a reference to this range
147102 TEMPLATE () LANGULUS(INLINED)
148- constexpr TME ()& TME()::operator = (const CT::RangeBased auto & r) noexcept {
103+ constexpr auto TME ()::operator = (const CT::RangeBased auto & r) noexcept -> TRange& {
149104 return *new (this ) TRange {DeintCast (r)};
150105 }
151106
152107 // / Copy vector
153108 // / @param v - the vector to copy
154109 // / @return a reference to this range
155110 TEMPLATE () LANGULUS(INLINED)
156- constexpr TME ()& TME()::operator = (const CT::VectorBased auto & v) noexcept {
111+ constexpr auto TME ()::operator = (const CT::VectorBased auto & v) noexcept -> TRange& {
157112 return *new (this ) TRange {DeintCast (v)};
158113 }
159114
160115 // / Copy scalar
161116 // / @param s - the scalar value
162117 // / @return a reference to this range
163118 TEMPLATE () LANGULUS(INLINED)
164- constexpr TME ()& TME()::operator = (const CT::ScalarBased auto & s) noexcept {
119+ constexpr auto TME ()::operator = (const CT::ScalarBased auto & s) noexcept -> TRange& {
165120 return *new (this ) TRange {DeintCast (s)};
166121 }
167122
168123 // / Set only a specific component
169124 // / @param c - the component to overwrite
170125 // / @return a reference to this vector
171- TEMPLATE ()
172- template <CT::ScalarBased N, CT::Dimension D>
173- LANGULUS (INLINED)
126+ TEMPLATE () template <CT::ScalarBased N, CT::Dimension D> LANGULUS (INLINED)
174127 constexpr auto& TME()::operator = (const TVectorComponent<N, D>& c) noexcept {
175128 return *new (this ) TRange {PointType {c}};
176129 }
@@ -195,36 +148,36 @@ namespace Langulus::Math
195148 }
196149
197150 TEMPLATE () LANGULUS(INLINED)
198- constexpr TME ()& TME()::Embrace(const auto & other) noexcept {
151+ constexpr auto TME ()::Embrace(const auto & other) noexcept -> TRange& {
199152 mMin = Min (mMin , other);
200153 mMax = Max (mMax , other);
201154 return *this ;
202155 }
203156
204157 TEMPLATE () LANGULUS(INLINED)
205- constexpr TME ()& TME()::ConstrainBy(const auto & limits) noexcept {
158+ constexpr auto TME ()::ConstrainBy(const auto & limits) noexcept -> TRange& {
206159 mMin = Clamp (mMin , limits.mMin , limits.mMax );
207160 mMax = Clamp (mMax , limits.mMin , limits.mMax );
208161 return *this ;
209162 }
210163
211164 TEMPLATE () LANGULUS(INLINED)
212- const typename TME ()::PointType& TME():: GetMin() const noexcept {
165+ auto TME ()::GetMin() const noexcept -> const PointType& {
213166 return mMin ;
214167 }
215168
216169 TEMPLATE () LANGULUS(INLINED)
217- const typename TME ()::PointType& TME():: GetMax() const noexcept {
170+ auto TME ()::GetMax() const noexcept -> const PointType& {
218171 return mMax ;
219172 }
220173
221174 TEMPLATE () LANGULUS(INLINED)
222- typename TME ()::PointType TME():: Length() const noexcept {
175+ auto TME ()::Length() const noexcept -> PointType {
223176 return mMax - mMin ;
224177 }
225178
226179 TEMPLATE () LANGULUS(INLINED)
227- typename TME ()::PointType TME():: Center() const noexcept {
180+ auto TME ()::Center() const noexcept -> PointType {
228181 return mMin + Length () * 0 .5f ;
229182 }
230183
@@ -244,25 +197,25 @@ namespace Langulus::Math
244197 }
245198
246199 TEMPLATE () LANGULUS(INLINED)
247- constexpr typename TME ()::PointType TME():: ClampRev(const PointType& pos) const noexcept {
200+ constexpr auto TME ()::ClampRev(const PointType& pos) const noexcept -> PointType {
248201 return pos.ClampRev (mMin , mMax );
249202 }
250203
251204 TEMPLATE () LANGULUS(INLINED)
252- constexpr typename TME ()::PointType TME():: Clamp(const PointType& pos) const noexcept {
205+ constexpr auto TME ()::Clamp(const PointType& pos) const noexcept -> PointType {
253206 return pos.Clamp (mMin , mMax );
254207 }
255208
256209 TEMPLATE () LANGULUS(INLINED)
257- constexpr TME () TME()::operator | (const TME ()& a) const noexcept {
210+ constexpr auto TME ()::operator | (const TME ()& a) const noexcept -> TRange {
258211 return {
259212 mMin .Clamp (a.mMin , a.mMax ),
260213 mMax .Clamp (a.mMin , a.mMax )
261214 };
262215 }
263216
264217 TEMPLATE () LANGULUS(INLINED)
265- constexpr TME()& TME()::operator |= (const TME ()& a) noexcept {
218+ constexpr auto TME()::operator |= (const TME ()& a) noexcept -> TRange& {
266219 *this = *this | a;
267220 }
268221
@@ -273,12 +226,12 @@ namespace Langulus::Math
273226 // / minX minY minZ ... maxX maxY maxZ ...
274227 // / @returns a reference to the component
275228 TEMPLATE () LANGULUS(INLINED)
276- constexpr TypeOf<T>& TME()::operator [] (const Offset a) noexcept {
229+ constexpr auto TME()::operator [] (const Offset a) noexcept -> MemberType& {
277230 return mArray [a];
278231 }
279232
280233 TEMPLATE () LANGULUS(INLINED)
281- constexpr const TypeOf<T>& TME()::operator [] (const Offset a) const noexcept {
234+ constexpr auto TME()::operator [] (const Offset a) const noexcept -> const MemberType& {
282235 return mArray [a];
283236 }
284237
@@ -434,35 +387,31 @@ namespace Langulus::Math
434387 // /
435388
436389 // / Add
437- template <class T1 , class T2 >
438- LANGULUS (INLINED)
390+ template <class T1 , class T2 > LANGULUS (INLINED)
439391 auto& operator += (TRange<T1>& me, const TRange<T2>& other) noexcept {
440392 me.mMin += other.mMin ;
441393 me.mMax += other.mMax ;
442394 return me;
443395 }
444396
445397 // / Subtract
446- template <class T1 , class T2 >
447- LANGULUS (INLINED)
398+ template <class T1 , class T2 > LANGULUS (INLINED)
448399 auto& operator -= (TRange<T1>& me, const TRange<T2>& other) noexcept {
449400 me.mMin -= other.mMin ;
450401 me.mMax -= other.mMax ;
451402 return me;
452403 }
453404
454405 // / Multiply
455- template <class T1 , class T2 >
456- LANGULUS (INLINED)
406+ template <class T1 , class T2 > LANGULUS (INLINED)
457407 auto& operator *= (TRange<T1>& me, const TRange<T2>& other) noexcept {
458408 me.mMin *= other.mMin ;
459409 me.mMax *= other.mMax ;
460410 return me;
461411 }
462412
463413 // / Divide
464- template <class T1 , class T2 >
465- LANGULUS (INLINED)
414+ template <class T1 , class T2 > LANGULUS (INLINED)
466415 auto& operator /= (TRange<T1>& me, const TRange<T2>& other) {
467416 me.mMin /= other.mMin ;
468417 me.mMax /= other.mMax ;
0 commit comments