提问人:awakair 提问时间:11/11/2023 更新时间:11/11/2023 访问量:87
为什么我可以将<unordered_map>与引用一起使用,但不能将<stack>与它们一起使用?
Why I can use <unordered_map> with references but I can't use <stack> with them?
问:
<unordered_map>
with references 工作正常,但甚至无法编译<stack>
我有并且它工作正常,但是当我尝试声明时出现错误std::unordered_map<char, Argument&>
std::stack<Argument&>
In template: 'allocate' declared as a pointer to a reference of type 'ArgumentParser::ArgParser::Argument &'
答: 暂无答案
评论
reference_wrapper
可以重新绑定!std::shared_ptr<Argument>
std::unordered_map
std::pair<char, Argument&>