STL like container typedef shortcut?

后端 未结 7 1129
有刺的猬
有刺的猬 2021-01-26 22:56

A common pattern with STL containers is this:

map map;
for(map::iterator iter = map.begin(); iter != map.end(); ++iter)
{
  .         


        
7条回答
  •  鱼传尺愫
    2021-01-26 23:42

    If the typedef is local to a single function it doesn't even need to be a nice name. Use X or MAP, just like in a template.

提交回复
热议问题