Retrieving the type of auto in C++11 without executing the program

后端 未结 5 1548
悲&欢浪女
悲&欢浪女 2021-01-11 10:10

I have some C++11 code using the auto inferred type that I have to convert to C++98. How would I go about converting the code, substituting in the actual type f

5条回答
  •  长情又很酷
    2021-01-11 10:44

    You can try to use the BOOST_AUTO macro in the Boost typeof library.

    auto x = 5 + 7;
    

    becomes

    BOOST_AUTO(x,5+7);
    

提交回复
热议问题