oct*_*ian 2 c++ size constructor stl set
在C++中,我已经包含了set
库:
#include <set>
Run Code Online (Sandbox Code Playgroud)
我想创建一个具有与另一个元素相同的元素的集合.所以,我试过这个:
set<int> ret((int)ring.size());
Run Code Online (Sandbox Code Playgroud)
但是,我收到此错误:
error: no matching constructor for initialization of 'set<int>'
Run Code Online (Sandbox Code Playgroud)
任何想法如何从声明中指定集合的大小?
归档时间: |
|
查看次数: |
411 次 |
最近记录: |