fork download
  1. #include <boost/typeof/typeof.hpp>
  2. #include <iostream>
  3. #include <typeinfo>
  4.  
  5. int main() {
  6. int a; float b;
  7. BOOST_TYPEOF(a+b) c = a+b;
  8. std::cout << typeid(c).name() << std::endl;
  9. }
  10.  
Success #stdin #stdout 0s 16064KB
stdin
Standard input is empty
stdout
f