boost_no_cxx17_std_apply.ipp 665 B

12345678910111213141516171819202122232425262728
  1. // (C) Copyright Oliver Kowalke 2016.
  2. // Use, modification and distribution are subject to the
  3. // Boost Software License, Version 1.0. (See accompanying file
  4. // LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
  5. // See http://www.boost.org/libs/config for most recent version.
  6. // MACRO: BOOST_NO_CXX17_STD_APPLY
  7. // TITLE: apply
  8. // DESCRIPTION: The compiler supports the std::apply() function.
  9. #include <functional>
  10. #include <tuple>
  11. namespace boost_no_cxx17_std_apply {
  12. int foo( int i, int j) {
  13. return i + j;
  14. }
  15. int test() {
  16. int i = 1, j = 2;
  17. std::apply( foo, std::make_tuple( i, j) );
  18. return 0;
  19. }
  20. }