Behavior of decltype

后端 未结 3 1485
感情败类
感情败类 2020-12-10 04:53

Say I have an object of some of stl container classes obj. I can define other object of same type this way:

decltype(obj) obj2;
<
3条回答
  •  温柔的废话
    2020-12-10 05:03

    Yet another workaround until VC++'s parser is fixed to reflect the FDIS is to use the std::identity<> metafunction:

    std::identity::type::iterator it = obj.begin();
    

提交回复
热议问题