@@ -250,24 +250,26 @@ template <int Nurse, int Patient> struct process_attribute<keep_alive<Nurse, Pat
250
250
static void postcall (handle args, handle ret) { keep_alive_impl (Nurse, Patient, args, ret); }
251
251
};
252
252
253
+ // / Ignore that a variable is unused in compiler warnings
254
+ template <class T > void ignore_unused (const T&) { }
253
255
254
256
// / Recursively iterate over variadic template arguments
255
257
template <typename ... Args> struct process_attributes {
256
258
static void init (const Args&... args, function_record *r) {
257
259
int unused[] = { 0 , (process_attribute<typename std::decay<Args>::type>::init (args, r), 0 ) ... };
258
- ( void ) unused; ( void ) r ;
260
+ ignore_unused ( unused) ;
259
261
}
260
262
static void init (const Args&... args, type_record *r) {
261
263
int unused[] = { 0 , (process_attribute<typename std::decay<Args>::type>::init (args, r), 0 ) ... };
262
- ( void ) unused; ( void ) r ;
264
+ ignore_unused ( unused) ;
263
265
}
264
266
static void precall (handle fn_args) {
265
267
int unused[] = { 0 , (process_attribute<typename std::decay<Args>::type>::precall (fn_args), 0 ) ... };
266
- ( void ) unused; ( void ) fn_args ;
268
+ ignore_unused ( unused) ;
267
269
}
268
270
static void postcall (handle fn_args, handle fn_ret) {
269
271
int unused[] = { 0 , (process_attribute<typename std::decay<Args>::type>::postcall (fn_args, fn_ret), 0 ) ... };
270
- ( void ) unused; ( void ) fn_args; ( void ) fn_ret ;
272
+ ignore_unused ( unused) ;
271
273
}
272
274
};
273
275
0 commit comments