Advertisement
Guest User

Untitled

a guest
Oct 9th, 2013
87
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 1.20 KB | None | 0 0
  1. //#include <boost/fusion/container/vector.hpp>
  2. #include <boost/mpl/vector.hpp>
  3. #include <boost/fusion/algorithm/transformation/transform.hpp>
  4. #include <boost/fusion/container/vector/convert.hpp>
  5. #include <boost/type_traits/remove_pointer.hpp>
  6.  
  7. namespace fusion = boost::fusion;
  8. namespace mpl    = boost::mpl;
  9.  
  10. template <typename... T>
  11. struct inspect {
  12. };
  13.  
  14. template <typename... Args>
  15. struct testcase
  16. {
  17.     using argvec  = boost::mpl::vector<Args...>;
  18.     using noptrs  = typename fusion::result_of::transform
  19.                         <argvec, boost::remove_pointer<mpl::_>>::type;
  20.     using type    = typename inspect
  21.                         <typename fusion::result_of::as_vector<noptrs>::type>::
  22.                             type;
  23. };
  24.  
  25. int main() {
  26.     using x = testcase<int*, int(*)(double)>::type;
  27. }
  28.  
  29. /*
  30.  * test-fusion.cpp: In instantiation of ‘struct testcase<int*, int (*)(double)>’:
  31.  * test-fusion.cpp:26:45:   required from here
  32.  * test-fusion.cpp:22:33: error: no type named ‘type’ in ‘struct inspect<boost::fusion::vector2<boost::fusion::detail::apply_transform_result<int>, boost::fusion::detail::apply_transform_result<int(double)> > >’
  33.  *                             type;
  34.  */
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement