null_output_iterator.hpp 876 B

12345678910111213141516171819202122232425262728293031323334
  1. /*
  2. An output iterator which simply discards output.
  3. */
  4. // Copyright Frank Mori Hess 2008.
  5. // Distributed under the Boost Software License, Version
  6. // 1.0. (See accompanying file LICENSE_1_0.txt or copy at
  7. // http://www.boost.org/LICENSE_1_0.txt)
  8. // See http://www.boost.org/libs/signals2 for library home page.
  9. #ifndef BOOST_SIGNALS2_NULL_OUTPUT_ITERATOR_HPP
  10. #define BOOST_SIGNALS2_NULL_OUTPUT_ITERATOR_HPP
  11. #include <boost/function_output_iterator.hpp>
  12. namespace boost
  13. {
  14. namespace signals2
  15. {
  16. namespace detail
  17. {
  18. class does_nothing
  19. {
  20. public:
  21. template<typename T>
  22. void operator()(const T&) const
  23. {}
  24. };
  25. typedef boost::function_output_iterator<does_nothing> null_output_iterator;
  26. } // namespace detail
  27. } // namespace signals2
  28. } // namespace boost
  29. #endif // BOOST_SIGNALS2_NULL_OUTPUT_ITERATOR_HPP