Fix a lot of ref issues reagrding extarction, rvalueness and proper use of temporary memory.
This commit is contained in:
parent
d5c41bf43e
commit
379d77ebef
50 changed files with 2945 additions and 1397 deletions
|
|
@ -5,9 +5,10 @@
|
|||
SPDX-License-Identifier: BSL-1.0
|
||||
*/
|
||||
//==================================================================================================
|
||||
#include "unit/tests.hpp"
|
||||
#include <rotgen/rotgen.hpp>
|
||||
|
||||
#include "unit/tests.hpp"
|
||||
|
||||
template<int size = rotgen::Dynamic,
|
||||
typename Scalar = float,
|
||||
int maxSize = size>
|
||||
|
|
@ -63,3 +64,34 @@ TTS_CASE("Reference of reference check")
|
|||
TTS_EQUAL(v2[0], sum2);
|
||||
TTS_EQUAL(v3[0], sum3);
|
||||
};
|
||||
|
||||
int f(rotgen::ref<rotgen::matrix<float, 1, 3, rotgen::RowMajor>>)
|
||||
{
|
||||
return +2;
|
||||
}
|
||||
|
||||
template<int N>
|
||||
int g(rotgen::ref<rotgen::matrix<float, -1, N, rotgen::ColMajor>>)
|
||||
{
|
||||
return +1;
|
||||
}
|
||||
|
||||
template<int N>
|
||||
int g(rotgen::ref<rotgen::matrix<float, -1, N, rotgen::RowMajor>>)
|
||||
requires(N > 1)
|
||||
{
|
||||
return -1;
|
||||
}
|
||||
|
||||
TTS_CASE("Reference overload on stroage order check")
|
||||
{
|
||||
rotgen::matrix<float> mat_dyn(1, 3);
|
||||
rotgen::matrix<float, -1, 3, rotgen::ColMajor> mat_col(1, 3);
|
||||
rotgen::matrix<float, -1, 3, rotgen::RowMajor> mat_row(1, 3);
|
||||
|
||||
TTS_EQUAL(f(mat_dyn), +2);
|
||||
|
||||
TTS_EQUAL(g<3>(mat_dyn), +1);
|
||||
TTS_EQUAL(g<3>(mat_col), +1);
|
||||
TTS_EQUAL(g<3>(mat_row), -1);
|
||||
};
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue