Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
fengchen509 opened this issue May 20, 2023 · 3 comments
Open

Comments

@fengchen509
Copy link

编译报错

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冲突了?还是其它啥问题啊?

@zouxiaohang
Copy link
Owner

zouxiaohang commented May 20, 2023 via email

@Togetabetterplace
Copy link

好像是跟MSVC的utility冲突了

@zouxiaohang
Copy link
Owner

zouxiaohang commented Mar 1, 2024 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants