apply.hpp 615 B

1234567891011121314151617181920212223242526272829
  1. #ifndef BOOST_BIND_APPLY_HPP_INCLUDED
  2. #define BOOST_BIND_APPLY_HPP_INCLUDED
  3. //
  4. // apply.hpp
  5. //
  6. // Copyright 2002, 2003, 2024 Peter Dimov
  7. //
  8. // Distributed under the Boost Software License, Version 1.0. (See
  9. // accompanying file LICENSE_1_0.txt or copy at
  10. // http://www.boost.org/LICENSE_1_0.txt)
  11. //
  12. namespace boost
  13. {
  14. template<class R> struct apply
  15. {
  16. typedef R result_type;
  17. template<class F, class... A> result_type operator()( F&& f, A&&... a ) const
  18. {
  19. return static_cast<F&&>( f )( static_cast<A&&>( a )... );
  20. }
  21. };
  22. } // namespace boost
  23. #endif // #ifndef BOOST_BIND_APPLY_HPP_INCLUDED