std::tuple get() member function

后端 未结 3 1342
故里飘歌
故里飘歌 2020-12-04 01:17

boost::tuple has a get() member function used like this:

tuple t(5, \"foo\", \"bar\");
cout << t.g         


        
3条回答
  •  猫巷女王i
    2020-12-04 02:11

    N3090/3092, §20.4.2.6/8: "Note: The reason get is a nonmember function is that if this functionality had been provided as a member function, code where the type depended on a template parameter would have required using the template keyword. —end note"

提交回复
热议问题