populating an std::[container] from a function by passing an output iterator

前端 未结 2 1741
情歌与酒
情歌与酒 2021-01-20 01:02

I want to populate a container from inside a function by passing an output iterator as this is the most efficient way to do it as I understand. e.g.

template         


        
2条回答
  •  孤城傲影
    2021-01-20 01:39

    You don't need to. The code will fail to compile anyway if the caller passes the wrong iterator type.

    So it's enforced for you already.

提交回复
热议问题