Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
gaoqiong
pybind11
Commits
fa92f679
Commit
fa92f679
authored
Jan 21, 2016
by
Wenzel Jakob
Browse files
Merge pull request #76 from ax3l/fix-unusedVar
Close #69 Unused Var: Warning
parents
d1f4d3ea
2dd5e3bc
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
6 additions
and
4 deletions
+6
-4
include/pybind11/attr.h
include/pybind11/attr.h
+6
-4
No files found.
include/pybind11/attr.h
View file @
fa92f679
...
...
@@ -250,24 +250,26 @@ template <int Nurse, int Patient> struct process_attribute<keep_alive<Nurse, Pat
static
void
postcall
(
handle
args
,
handle
ret
)
{
keep_alive_impl
(
Nurse
,
Patient
,
args
,
ret
);
}
};
/// Ignore that a variable is unused in compiler warnings
template
<
class
T
>
void
ignore_unused
(
const
T
&
)
{
}
/// Recursively iterate over variadic template arguments
template
<
typename
...
Args
>
struct
process_attributes
{
static
void
init
(
const
Args
&
...
args
,
function_record
*
r
)
{
int
unused
[]
=
{
0
,
(
process_attribute
<
typename
std
::
decay
<
Args
>::
type
>::
init
(
args
,
r
),
0
)
...
};
(
void
)
unused
;
(
void
)
r
;
ignore_unused
(
unused
)
;
}
static
void
init
(
const
Args
&
...
args
,
type_record
*
r
)
{
int
unused
[]
=
{
0
,
(
process_attribute
<
typename
std
::
decay
<
Args
>::
type
>::
init
(
args
,
r
),
0
)
...
};
(
void
)
unused
;
(
void
)
r
;
ignore_unused
(
unused
)
;
}
static
void
precall
(
handle
fn_args
)
{
int
unused
[]
=
{
0
,
(
process_attribute
<
typename
std
::
decay
<
Args
>::
type
>::
precall
(
fn_args
),
0
)
...
};
(
void
)
unused
;
(
void
)
fn_args
;
ignore_unused
(
unused
)
;
}
static
void
postcall
(
handle
fn_args
,
handle
fn_ret
)
{
int
unused
[]
=
{
0
,
(
process_attribute
<
typename
std
::
decay
<
Args
>::
type
>::
postcall
(
fn_args
,
fn_ret
),
0
)
...
};
(
void
)
unused
;
(
void
)
fn_args
;
(
void
)
fn_ret
;
ignore_unused
(
unused
)
;
}
};
...
...
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