Update of /cvsroot/boost-sandbox/boost-sandbox/libs/units/example
In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv22780/boost-sandbox/libs/units/example
Modified Files:
unit_example_15.cpp
Log Message:
suppress unused variable warnings
Index: unit_example_15.cpp
===================================================================
RCS file: /cvsroot/boost-sandbox/boost-sandbox/libs/units/example/unit_example_15.cpp,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -d -r1.5 -r1.6
--- unit_example_15.cpp 11 Apr 2007 21:24:04 -0000 1.5
+++ unit_example_15.cpp 13 Apr 2007 01:15:39 -0000 1.6
@@ -64,6 +64,9 @@
} // namespace boost
+template<class T>
+void suppress_unused_variable_warning(T&) {}
+
int main(void)
{
using namespace boost::units;
@@ -83,6 +86,12 @@
quantity<world_space_unit,vector> wsv3(wsv1);
quantity<object_space_unit,vector> osv3(osv1);
+ suppress_unused_variable_warning(wsv2);
+ suppress_unused_variable_warning(osv2);
+
+ suppress_unused_variable_warning(wsv3);
+ suppress_unused_variable_warning(osv3);
+
#if defined(BOOST_UNITS_EXAMPLE_15_FAIL) && BOOST_UNITS_EXAMPLE_15_FAIL == 1
// compile-time error if either of these is uncommented
quantity<world_space_unit,vector> wsv4(osv1);
@@ -105,6 +114,12 @@
world_space_vector wsv3(wsv1);
object_space_vector osv3(osv1);
+
+ suppress_unused_variable_warning(wsv2);
+ suppress_unused_variable_warning(osv2);
+
+ suppress_unused_variable_warning(wsv3);
+ suppress_unused_variable_warning(osv3);
#if defined(BOOST_UNITS_EXAMPLE_15_FAIL) && BOOST_UNITS_EXAMPLE_15_FAIL == 2
// compile-time error if either of these is uncommented
@@ -130,6 +145,12 @@
world_space_vector_type wsv3(wsv1);
object_space_vector_type osv3(osv1);
+
+ suppress_unused_variable_warning(wsv2);
+ suppress_unused_variable_warning(osv2);
+
+ suppress_unused_variable_warning(wsv3);
+ suppress_unused_variable_warning(osv3);
#if defined(BOOST_UNITS_EXAMPLE_15_FAIL) && BOOST_UNITS_EXAMPLE_15_FAIL == 3
// compile-time error if either of these is uncommented because conversion is not defined
|