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

when i use for(auto iter& : jsonObject) it occure some error #3893

Closed
2 tasks
YuDe95 opened this issue Dec 20, 2022 · 2 comments
Closed
2 tasks

when i use for(auto iter& : jsonObject) it occure some error #3893

YuDe95 opened this issue Dec 20, 2022 · 2 comments
Labels
kind: bug state: needs more info the author of the issue needs to provide more details

Comments

@YuDe95
Copy link

YuDe95 commented Dec 20, 2022

Description

when i use for(auto iter& : jsonObject) it occure some error

for(auto &it : SRMData)
{
            m_SRMModelDataOperation->addSRMModelData(QString::fromStdString(it.dump(4)));
 }

Reproduction steps

maybe i change a compler

Expected vs. actual results

Compilation passed

Minimal code example

No response

Error messages

---\Libs\Utils\nlohmann\json.hpp:13291: maybe“bool nlohmann::json_abi_v3_11_2::detail::iter_impl<nlohmann::json_abi_v3_11_2::basic_json<std::map,std::vector,std::string,bool,int64_t,uint64_t,double,std::allocator,nlohmann::json_abi_v3_11_2::adl_serializer,std::vector<unsigned char,std::allocator<unsigned char>>>>::operator !=<nlohmann::json_abi_v3_11_2::detail::iter_impl<nlohmann::json_abi_v3_11_2::basic_json<std::map,std::vector,std::string,bool,int64_t,uint64_t,double,std::allocator,nlohmann::json_abi_v3_11_2::adl_serializer,std::vector<unsigned char,std::allocator<unsigned char>>>>,nullptr>(const IterImpl &) const”
with
[
    IterImpl=nlohmann::json_abi_v3_11_2::detail::iter_impl<nlohmann::json_abi_v3_11_2::basic_json<std::map,std::vector,std::string,bool,int64_t,uint64_t,double,std::allocator,nlohmann::json_abi_v3_11_2::adl_serializer,std::vector<unsigned char,std::allocator<unsigned char>>>>
]
**or**
C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\VC\Tools\MSVC\14.29.30133\include\utility:406: or    “bool std::rel_ops::operator !=<nlohmann::json_abi_v3_11_2::detail::iter_impl<nlohmann::json_abi_v3_11_2::basic_json<std::map,std::vector,std::string,bool,int64_t,uint64_t,double,std::allocator,nlohmann::json_abi_v3_11_2::adl_serializer,std::vector<unsigned char,std::allocator<unsigned char>>>>>(const _Ty &,const _Ty &)”
with
[
    _Ty=nlohmann::json_abi_v3_11_2::detail::iter_impl<nlohmann::json_abi_v3_11_2::basic_json<std::map,std::vector,std::string,bool,int64_t,uint64_t,double,std::allocator,nlohmann::json_abi_v3_11_2::adl_serializer,std::vector<unsigned char,std::allocator<unsigned char>>>>
]

\GUI\mainwindow.cpp:3057: Try to match parameter list“(nlohmann::json_abi_v3_11_2::detail::iter_impl<nlohmann::json_abi_v3_11_2::basic_json<std::map,std::vector,std::string,bool,int64_t,uint64_t,double,std::allocator,nlohmann::json_abi_v3_11_2::adl_serializer,std::vector<unsigned char,std::allocator<unsigned char>>>>, nlohmann::json_abi_v3_11_2::detail::iter_impl<nlohmann::json_abi_v3_11_2::basic_json<std::map,std::vector,std::string,bool,int64_t,uint64_t,double,std::allocator,nlohmann::json_abi_v3_11_2::adl_serializer,std::vector<unsigned char,std::allocator<unsigned char>>>>)”

Compiler and operating system

compiler:mvc 16.11.33130.400 amd 64 win10

Library version

json version 3.11.2

Validation

@nlohmann
Copy link
Owner

Minimal code example missing.

@nlohmann nlohmann added the state: needs more info the author of the issue needs to provide more details label Dec 20, 2022
@YuDe95
Copy link
Author

YuDe95 commented Dec 20, 2022

i find where i made this error.in my project somewhere,i use std::rel_ops,this will auto generate other operator function ,so it make the error occur.

@YuDe95 YuDe95 closed this as completed Dec 20, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind: bug state: needs more info the author of the issue needs to provide more details
Projects
None yet
Development

No branches or pull requests

2 participants