-
-
Notifications
You must be signed in to change notification settings - Fork 163
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
Iterate over nested Tables (Array of Tables) #219
Comments
Yeah for_each() should work in the way you've tried it in the first example, and it's not immediately clear to me why it's not here. I'll have a look into it a bit later :) |
If it helps this is the complete Error Message i got using the
|
Is this possibly related to the issue I am experiencing as well? I tried to upgrade |
Having the same issue with MSVC 19.39.33523.0 when using tomlplusplus 3.4.0 via vcpkg:
Downgrading to v3.3.0 via vcpkg.json fixes the issue: {
"dependencies": [
"tomlplusplus",
],
"overrides": [
{
"name": "tomlplusplus",
"version": "3.3.0"
}
]
}
The same CMake project compiles fine when using clang v15 on macOS with v3.4.0 and v3.3.0. I wonder if this is a regression in tomlplusplus v3.4.0. |
Hi Kevin, I just encountered the same issue! It appears that the old lambda processor of Visual C++ is buggy. It does not seem to understand some conditional noexcept's in lambda's, for example at: tomlplusplus/include/toml++/impl/array.hpp Line 925 in d00dd1f
tomlplusplus/include/toml++/impl/table.hpp Line 933 in d00dd1f
You can get an "updated" lambda processor by compiler option It's still a bit cumbersome, of course. @marzer Hi Mark! Would it be an option to allow disabling those conditional noexcept's, for example by a macro like In Visual Studio 2022, the compiler errors can be reproduced by opening "toml++.sln", opening the Properties of one of the projects in "tests" (via Solution Explorer), for example "test_debug_x64", and then manually changing its Language property Conformance mode to Default, or No (/permissive) |
No, it's fine if they're disabled. They're only an optimization; removing them just means you lose the |
Thanks @marzer ! Just out of personal interest, do you expect an observable run-time performance gain from these particular noexcept annotations? (In general, I have seen both positive and negative performance effects from using noexcept, depending on the use case.) |
Heh, that's a question with no one specific answer, sadly. Even just within the MSVC universe it used to actively be a pessimization to specify I know that these days most compilers will be able to optimize nested inlines better when they can see the "noexceptness" is consistent throughout, but apart from that I mostly see it more as a programmer communication tool - it's quite valuable to be able to say in the code "this only throws when X". |
Offered a workaround to compile errors like "error C2057: expected constant expression", when using the "legacy lambda processor" of Visual C++. Such compile errors were reported by Kevin Dick, Jan 19, 2024, at issue marzer#219
|
Offered a workaround to compile errors like "error C2057: expected constant expression", when using the "legacy lambda processor" of Visual C++. Such compile errors were reported by Kevin Dick, Jan 19, 2024, at issue marzer#219
Offered a workaround to compile errors like "error C2057: expected constant expression", when using the "legacy lambda processor" of Visual C++. Such compile errors were reported by Kevin Dick, Jan 19, 2024, at issue marzer#219
Hello, this is more a question then a real bug but there was no question to select.
I'm currently try to figure out how to iterate over a set of nested Tables. I tried the example from the Docs for the Arrays but this seems not to work, because i got compiler errors.
This is the Code that i tried:
And these are the errors i got:
The Toml i used:
With the following Code i was able to iterate over the nested Tables but i wonder if this is the best or recommended way to do it.
The text was updated successfully, but these errors were encountered: