-
Notifications
You must be signed in to change notification settings - Fork 66
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
BOOST_FUSION_ADAPT_ADT not enough actual parameters for macro
#158
Comments
The API of BOOST_FUSION_ADAPT_ADT doesn't foresee this use, nor the unit tests do. Because your snippet lies, it tells that it declare a Random Access Sequence, but yours cannot have the sequence elements modified. But naturally this is your concern inside your app 👐. Because if you don't do any action modifying the elements you are not going to have any issue. It might happen when someone else will overtake your code without knowing you did that. 😄 But to your very specific question emptiness in parameters is not portable across compilers (sadly). Therefore you can avoid the warning and surprises in the future if you just provide any C++ expression doing nothing. You can use Hope this helps. |
But Spirit's do and demonstrates it in an example.
Sadly this will confuse people looking at the code of the example. Thanks for your answer. |
Oups 🙊. I could add a check to BOOST_PP_IS_EMPTY to handle this case. I'll give it a try today. |
Huh, fusion have test with omitted arguments too fusion/test/sequence/adapt_struct.cpp Line 158 in f7b90f2
And produces bunch of warnings http://www.boost.org/development/tests/develop/output/teeks99-09-p-win2012R2-64on64-fusion-msvc-14-1-warnings.html#adapt_adt_named
I suspect it was here but had been removed in #124 |
On MSVC if one wants to leave the setter/getter empty, e.g.:
will get a warning message:
Is it safe to ignore it?
Are there any methods except disabling the warning to fix this? MSVC will compile fine and without the warning if you replace
/**/
with()
but it does not work for GCC and Clang,The text was updated successfully, but these errors were encountered: