fork download
  1. #include <iostream>
  2. #include <string>
  3. #include <vector>
  4. #include <boost/regex.hpp>
  5. #include <boost/type_index.hpp>
  6.  
  7. class Widget
  8. {
  9.  
  10. };
  11.  
  12. template<typename T>
  13. void f(const T& param)
  14. {
  15. using boost::typeindex::type_id_with_cvr;
  16. std::cout << "T = " << type_id_with_cvr<T>().pretty_name() << std::endl;
  17. std::cout << "Param = " << type_id_with_cvr<decltype(param)>().pretty_name() << std::endl;
  18. }
  19. std::vector<Widget> createVec()
  20. {
  21. std::vector<Widget> vec(5);
  22. return vec;
  23. }
  24. int main()
  25. {
  26. const auto vw = createVec();
  27. if (!vw.empty())
  28. f(&vw[0]);
  29. }
  30.  
Success #stdin #stdout 0.01s 5420KB
stdin
Standard input is empty
stdout
T =  Widget const*
Param =  Widget const* const&