diff --git a/call_traits_test.cpp b/call_traits_test.cpp index 95dd0d8..afeb285 100644 --- a/call_traits_test.cpp +++ b/call_traits_test.cpp @@ -17,6 +17,10 @@ #include #include + +// a way prevent warnings for unused variables +template inline void unused_variable(const T&) {} + // // struct contained models a type that contains a type (for example std::pair) // arrays are contained by value, and have to be treated as a special case: @@ -44,7 +48,7 @@ struct contained reference get() { return v_; } const_reference const_get()const { return v_; } // pass value: - void call(param_type p){} + void call(param_type){} }; @@ -69,7 +73,7 @@ struct contained // return by_ref: reference get() { return v_; } const_reference const_get()const { return v_; } - void call(param_type p){} + void call(param_type){} }; #endif @@ -214,8 +218,8 @@ int main(int argc, char *argv[ ]) #endif check_wrap(wrap(2), 2); - const char ca[4] = "abc"; // compiler can't deduce this for some reason: + //const char ca[4] = "abc"; //check_wrap(wrap(ca), ca); #ifndef BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION check_wrap(wrap(a), a); @@ -318,6 +322,19 @@ void call_traits_test::assert_construct(typename call_traits_test @@ -354,6 +371,17 @@ void call_traits_test::assert_construct(typename boost::call_traits: param_type p2(v); param_type p3(r); param_type p4(p); + + unused_variable(v2); + unused_variable(v3); + unused_variable(v4); + unused_variable(v5); + unused_variable(r2); + unused_variable(cr2); + unused_variable(cr3); + unused_variable(p2); + unused_variable(p3); + unused_variable(p4); } #endif //BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION // diff --git a/compressed_pair_test.cpp b/compressed_pair_test.cpp index c31a155..25a2cb4 100644 --- a/compressed_pair_test.cpp +++ b/compressed_pair_test.cpp @@ -199,7 +199,7 @@ struct compressed_pair_reference1_tester }; template -void compressed_pair_reference1_tester::test(first_param_type p1, second_param_type p2, first_param_type p3, second_param_type p4) +void compressed_pair_reference1_tester::test(first_param_type p1, second_param_type p2, first_param_type, second_param_type) { #ifndef BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION // first param construct: @@ -225,7 +225,7 @@ struct compressed_pair_reference2_tester }; template -void compressed_pair_reference2_tester::test(first_param_type p1, second_param_type p2, first_param_type p3, second_param_type p4) +void compressed_pair_reference2_tester::test(first_param_type p1, second_param_type p2, first_param_type, second_param_type) { #ifndef BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION // second param construct: @@ -252,7 +252,7 @@ struct compressed_pair_array1_tester }; template -void compressed_pair_array1_tester::test(first_param_type p1, second_param_type p2, first_param_type p3, second_param_type p4) +void compressed_pair_array1_tester::test(first_param_type p1, second_param_type p2, first_param_type, second_param_type) { // default construct: boost::compressed_pair cp1; @@ -282,7 +282,7 @@ struct compressed_pair_array2_tester }; template -void compressed_pair_array2_tester::test(first_param_type p1, second_param_type p2, first_param_type p3, second_param_type p4) +void compressed_pair_array2_tester::test(first_param_type p1, second_param_type p2, first_param_type, second_param_type) { // default construct: boost::compressed_pair cp1; @@ -312,7 +312,7 @@ struct compressed_pair_array_tester }; template -void compressed_pair_array_tester::test(first_param_type p1, second_param_type p2, first_param_type p3, second_param_type p4) +void compressed_pair_array_tester::test(first_param_type p1, second_param_type p2, first_param_type, second_param_type) { // default construct: boost::compressed_pair cp1; @@ -329,7 +329,7 @@ void compressed_pair_array_tester::test(first_param_type p1, second_para BOOST_TEST(sizeof(T2) == sizeof(cp1.second())); } -int test_main(int argc, char *argv[ ]) +int test_main(int, char **) { // declare some variables to pass to the tester: non_empty1 ne1(2); diff --git a/tie_example.cpp b/tie_example.cpp index cb5af4d..70b4b38 100644 --- a/tie_example.cpp +++ b/tie_example.cpp @@ -28,7 +28,7 @@ main(int, char*[]) { { typedef std::set SetT; - SetT::iterator i, end; + SetT::iterator i; bool inserted; int vals[5] = { 5, 2, 4, 9, 1 };