arg_copy_test.cpp 555 B

12345678910111213141516171819202122232425262728293031323334
  1. //
  2. // arg_copy_test.cpp - copying a custom placeholder _1 to arg<1>
  3. //
  4. // Copyright 2016 Peter Dimov
  5. //
  6. // Distributed under the Boost Software License, Version 1.0.
  7. // See accompanying file LICENSE_1_0.txt or copy at
  8. // http://www.boost.org/LICENSE_1_0.txt
  9. //
  10. #include <boost/is_placeholder.hpp>
  11. #include <boost/bind/arg.hpp>
  12. //
  13. template<int I> struct ph
  14. {
  15. };
  16. namespace boost
  17. {
  18. template<int I> struct is_placeholder< ::ph<I> >
  19. {
  20. enum _vt { value = I };
  21. };
  22. } // namespace boost
  23. int main()
  24. {
  25. boost::arg<1> a1 = ph<1>();
  26. (void)a1;
  27. }