- 论坛徽章:
- 0
|
如题,我测试了一下:
- int main(){
- auto f=[](const node& n){
- return (size_t)n.value;
- };
- unordered_set<node, decltype(f)> s2;
- return 0;
- }
复制代码 编译错误:
g++ -std=c++11 usehashset.cpp
usehashset.cpp: In function ‘int main()’:
usehashset.cpp:21:39: error: use of deleted function ‘std::unordered_set<_Value, _Hash, _Pred, _Alloc>::unordered_set() [with _Value = node; _Hash = main()::<lambda(const node&)>; _Pred = std::equal_to<node>; _Alloc = std::allocator<node>]’
unordered_set<node, decltype(f)> s2;
这个该怎么改呢?谢谢。
|
|