Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
KennethVanhoey
CGoGN
Commits
80fddd17
Commit
80fddd17
authored
Dec 05, 2012
by
Sylvain Thery
Browse files
add easy type conversions ..continue
parent
0c31658d
Changes
1
Hide whitespace changes
Inline
Side-by-side
include/Utils/convertType.h
View file @
80fddd17
...
...
@@ -86,6 +86,7 @@ inline const OUT* convertPtr(const IN* vec)
template
<
typename
OUT
,
typename
IN
>
inline
std
::
vector
<
OUT
>&
convertVector
(
std
::
vector
<
IN
>&
vec
)
{
...
...
@@ -102,6 +103,25 @@ inline const std::vector<OUT>& convertVector(const std::vector<IN>& vec)
}
template
<
typename
OUT
,
typename
IN
>
inline
const
std
::
list
<
OUT
>&
convertList
(
const
std
::
list
<
IN
>&
vec
)
{
assert
(
sizeof
(
IN
)
==
sizeof
(
OUT
)
||
"incompatible size cast"
);
return
*
(
reinterpret_cast
<
const
std
::
list
<
OUT
>*
>
(
&
vec
));
}
template
<
typename
OUT
,
typename
IN
>
inline
std
::
list
<
OUT
>&
convertList
(
std
::
list
<
IN
>&
vec
)
{
assert
(
sizeof
(
IN
)
==
sizeof
(
OUT
)
||
"incompatible size cast"
);
return
*
(
reinterpret_cast
<
std
::
list
<
OUT
>*
>
(
&
vec
));
}
}
// namespace Utils
}
// namespace CGoGN
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new 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