TinySTL icon indicating copy to clipboard operation
TinySTL copied to clipboard

编译报错:“TinySTL::swap”: 对重载函数的调用不明确

Open fengchen509 opened this issue 1 year ago • 3 comments

编译报错

D:\Program File\VS\ide\VC\Tools\MSVC\14.35.32215\include\utility(107,5): error C2668: “TinySTL::swap”: 对重载函数的调用不明确 1>D:\study-hard\cpp-project\TinySTL-master\TinySTL\Utility.h(9,7): message : 可能是“void TinySTL::swap<_Ty>(T &,T &)”[通过使用参数相关的查找找到] 1> with 1> [ 1> _Ty=std::_Tree_node<const TinySTL::binary_search_tree::node *,std::_Default_allocator_traits<std::allocator<const TinySTL::binary_search_tree::node *>>::void_pointer> *, 1> T=std::_Tree_node<const TinySTL::binary_search_tree::node *,std::_Default_allocator_traits<std::allocator<const TinySTL::binary_search_tree::node *>>::void_pointer> * 1> ] 1>D:\Program File\VS\ide\VC\Tools\MSVC\14.35.32215\include\utility(98,19): message : 或 “void std::swap<_Ty,0>(_Ty &,_Ty &) noexcept()” 1> with 1> [ 1> _Ty=std::_Tree_node<const TinySTL::binary_search_tree::node *,std::_Default_allocator_traits<std::allocator<const TinySTL::binary_search_tree::node *>>::void_pointer> * 1> ]

IDE:visual studio2022 系统:window11

是TinySTL::swap跟STL::swap冲突了?还是其它啥问题啊?

fengchen509 avatar May 20 '23 10:05 fengchen509

邹晓航已经收到了你发送的邮件~~

zouxiaohang avatar May 20 '23 10:05 zouxiaohang

好像是跟MSVC的utility冲突了

Togetabetterplace avatar Mar 01 '24 11:03 Togetabetterplace

邹晓航已经收到了你发送的邮件~~

zouxiaohang avatar Mar 01 '24 11:03 zouxiaohang