replace_slot_function.hpp 901 B

1234567891011121314151617181920212223242526272829303132
  1. // Copyright Frank Mori Hess 2007-2009
  2. //
  3. // Use, modification and
  4. // distribution is subject to the Boost Software License, Version
  5. // 1.0. (See accompanying file LICENSE_1_0.txt or copy at
  6. // http://www.boost.org/LICENSE_1_0.txt)
  7. // For more information, see http://www.boost.org
  8. #ifndef BOOST_SIGNALS2_DETAIL_REPLACE_SLOT_FUNCTION_HPP
  9. #define BOOST_SIGNALS2_DETAIL_REPLACE_SLOT_FUNCTION_HPP
  10. #include <boost/signals2/slot_base.hpp>
  11. namespace boost
  12. {
  13. namespace signals2
  14. {
  15. namespace detail
  16. {
  17. template<typename ResultSlot, typename SlotIn, typename SlotFunction>
  18. ResultSlot replace_slot_function(const SlotIn &slot_in, const SlotFunction &fun)
  19. {
  20. ResultSlot slot(fun);
  21. slot.track(slot_in);
  22. return slot;
  23. }
  24. } // namespace detail
  25. } // namespace signals2
  26. } // namespace boost
  27. #endif // BOOST_SIGNALS2_DETAIL_REPLACE_SLOT_FUNCTION_HPP