unpack.cpp 670 B

123456789101112131415161718192021222324252627
  1. /*=============================================================================
  2. Copyright (c) 2017 Paul Fultz II
  3. unpack.cpp
  4. Distributed under the Boost Software License, Version 1.0. (See accompanying
  5. file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
  6. ==============================================================================*/
  7. #include <boost/hof/unpack.hpp>
  8. struct foo
  9. {};
  10. namespace boost { namespace hof {
  11. template<>
  12. struct unpack_sequence<foo>
  13. {
  14. template<class F, class S>
  15. constexpr static int apply(F&&, S&&)
  16. {
  17. return 0;
  18. }
  19. };
  20. }
  21. int main() {
  22. boost::hof::unpack(boost::hof::always(1))(foo{});
  23. }