Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
OpenMesh
OpenMesh
Commits
0f42d48c
Commit
0f42d48c
authored
Feb 10, 2017
by
Janis Born
Browse files
make Vector11T converting ctor only accept at least 2 arguments
(hence making all single-argument ctors explicit)
parent
68770073
Pipeline
#4326
passed with stage
in 41 minutes and 33 seconds
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
src/OpenMesh/Core/Geometry/Vector11T.hh
View file @
0f42d48c
...
...
@@ -112,14 +112,16 @@ class VectorT {
//-------------------------------------------------------------- constructors
template
<
typename
...
T
,
typename
=
typename
std
::
enable_if
<
sizeof
...(
T
)
==
DIM
>
::
type
,
// Converting constructor: Constructs the vector from DIM values (of
// potentially heterogenous types) which are all convertible to Scalar.
template
<
typename
T
,
typename
...
Ts
,
typename
=
typename
std
::
enable_if
<
sizeof
...(
Ts
)
+
1
==
DIM
>
::
type
,
typename
=
typename
std
::
enable_if
<
are_convertible_to
<
Scalar
,
T
...
>::
value
>::
type
>
constexpr
VectorT
(
T
...
vs
)
:
values_
{
{
static_cast
<
Scalar
>
(
vs
)...}
}
{
static_assert
(
sizeof
...(
T
)
==
DIM
,
are_convertible_to
<
Scalar
,
T
,
Ts
...
>::
value
>::
type
>
constexpr
VectorT
(
T
v
,
Ts
...
vs
)
:
values_
{
{
static_cast
<
Scalar
>
(
v
),
static_cast
<
Scalar
>
(
vs
)...}
}
{
static_assert
(
sizeof
...(
T
s
)
+
1
==
DIM
,
"Invalid number of components specified in constructor."
);
static_assert
(
are_convertible_to
<
Scalar
,
T
...
>::
value
,
static_assert
(
are_convertible_to
<
Scalar
,
T
,
Ts
...
>::
value
,
"Not all components are convertible to Scalar."
);
}
...
...
@@ -367,8 +369,7 @@ class VectorT {
auto
operator
%
(
const
VectorT
<
OtherScalar
,
DIM
>
&
_rhs
)
const
->
typename
std
::
enable_if
<
DIM
==
3
,
VectorT
<
decltype
((
*
this
)[
0
]
*
_rhs
[
0
]
-
(
*
this
)[
0
]
*
_rhs
[
0
]),
DIM
>>::
type
{
(
*
this
)[
0
]
*
_rhs
[
0
]),
DIM
>>::
type
{
return
{
values_
[
1
]
*
_rhs
[
2
]
-
values_
[
2
]
*
_rhs
[
1
],
values_
[
2
]
*
_rhs
[
0
]
-
values_
[
0
]
*
_rhs
[
2
],
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment