Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
7
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Open sidebar
solverstack
ScalFMM
Commits
b268c0cc
Commit
b268c0cc
authored
Apr 20, 2017
by
Quentin Khan
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add a few static asserts to variadic_container
parent
187db7b0
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
9 additions
and
2 deletions
+9
-2
Src/Utils/variadic_container.hpp
Src/Utils/variadic_container.hpp
+9
-2
No files found.
Src/Utils/variadic_container.hpp
View file @
b268c0cc
...
...
@@ -911,7 +911,7 @@ private:
/** \brief Implements the insert algorithm for value movement or copy
*
* \tparam Value
Tuple a tuple type
of values or references
* \tparam Value
s a pack
of values or references
*
* \param pos Position before which to insert the values
* \param count Number of copies to insert
...
...
@@ -955,6 +955,8 @@ public:
*/
template
<
typename
ValueTuple
>
iterator
insert
(
const_iterator
pos
,
ValueTuple
&&
values
)
{
static_assert
(
std
::
tuple_size
<
std
::
decay_t
<
ValueTuple
>>::
value
==
sizeof
...(
Indices
),
"Given tuple does not have the right size"
);
return
insert_impl
(
pos
,
1
,
std
::
get
<
Indices
>
(
std
::
forward
<
ValueTuple
>
(
values
))...);
}
...
...
@@ -970,6 +972,8 @@ public:
*/
template
<
typename
ValueTuple
>
iterator
insert
(
const_iterator
pos
,
size_type
count
,
ValueTuple
&&
values
)
{
static_assert
(
std
::
tuple_size
<
std
::
decay_t
<
ValueTuple
>>::
value
==
sizeof
...(
Indices
),
"Given tuple does not have the right size"
);
return
insert_impl
(
pos
,
count
,
std
::
get
<
Indices
>
(
std
::
forward
<
ValueTuple
>
(
values
))...);
}
...
...
@@ -1166,6 +1170,9 @@ public:
*/
template
<
typename
...
Args
>
void
push_back
(
const
std
::
tuple
<
Args
...
>&
values
)
{
static_assert
(
sizeof
...(
Args
)
==
sizeof
...(
Indices
),
"Given tuple does not have the right size"
);
this
->
insert
(
this
->
end
(),
values
);
}
...
...
@@ -1203,7 +1210,7 @@ public:
* \param count New container size
*/
void
resize
(
size_type
count
)
{
this
->
resize
(
count
,
value_type
()
);
this
->
resize
(
count
,
value_type
{}
);
}
...
...
Write
Preview
Markdown
is supported
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