fork download
  1.  
  2. #include <iostream>
  3. #include <boost/preprocessor.hpp>
  4.  
  5. struct O
  6. {
  7. template <class T1, class T2>
  8. struct A {};
  9. };
  10. template<class T>
  11. struct argument_type;
  12. template<class T, class U>
  13. struct argument_type<T(U)>
  14. {
  15. using type = U;
  16. };
  17. #define DEF_VAR(TYPE, NAME) argument_type<void(TYPE)>::type NAME
  18. int main()
  19. {
  20. #define MEM ((O::A<int*, int>))(val)
  21. #define SEQ (MEM)
  22. DEF_VAR
  23. (
  24. BOOST_PP_SEQ_ELEM(0, BOOST_PP_SEQ_HEAD(SEQ)),
  25. BOOST_PP_SEQ_ELEM(1, BOOST_PP_SEQ_HEAD(SEQ))
  26. );
  27. }
Success #stdin #stdout 0s 15232KB
stdin
Standard input is empty
stdout
Standard output is empty