fork(1) download
  1. #include <iostream>
  2. #include <boost/call_traits.hpp>
  3. using namespace std;
  4.  
  5. template<typename T>
  6. struct Test
  7. {
  8. T t;
  9. Test( typename boost::call_traits<T>::param_type t_ ) : t(t_) {}
  10. };
  11.  
  12. Test<int> foo()
  13. {
  14. return 3;
  15. }
  16.  
  17.  
  18. int main() {
  19.  
  20. auto res = foo();
  21. cout<<"foo returns "<<res.t<<"\n";
  22. return 0;
  23. }
Success #stdin #stdout 0s 4404KB
stdin
Standard input is empty
stdout
foo returns 3