2 Copyright 2014 Adam Wulkiewicz
4 Distributed under the Boost Software License, Version 1.0.
6 See accompanying file LICENSE_1_0.txt
7 or copy at http://boost.org/LICENSE_1_0.txt
10 [section:ignore_unused ignore_unused]
18 [section Header <boost/core/ignore_unused.hpp>]
20 The header `<boost/core/ignore_unused.hpp>` defines the function template
21 `boost::ignore_unused()`. It may be used to suppress the "unused variable" or
22 "unused local typedefs" compiler warnings when the variable or typedef
23 can't be removed or commented out, e.g. when some blocks of the code are
24 conditionally activated. C++11 variadic templates are used if they're supported,
25 otherwise they're emulated with overloads.
30 boost::ignore_unused(v1, v2, v3);
31 boost::ignore_unused<T1, T2, T3>();
39 int fun( int foo, int bar )
41 boost::ignore_unused(bar);
42 #ifdef ENABLE_DEBUG_OUTPUT
44 std::cerr << "warning! foo < bar";
54 [section Acknowledgments]
56 `boost::ignore_unused()` was contributed by Adam Wulkiewicz.