GithubHelp home page GithubHelp logo

Comments (4)

daminetreg avatar daminetreg commented on July 1, 2024

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 val instead of /**/. In the end the expression will be pasted into a setter function which will do only : val;.

Hope this helps.

from fusion.

Kojoley avatar Kojoley commented on July 1, 2024

The API of BOOST_FUSION_ADAPT_ADT doesn't foresee this use, nor the unit tests do.

But Spirit's do and demonstrates it in an example.

You can use val instead of /**/. In the end the expression will be pasted into a setter function which will do only : val;.

Sadly this will confuse people looking at the code of the example.

Thanks for your answer.

from fusion.

daminetreg avatar daminetreg commented on July 1, 2024

Oups 🙊.

I could add a check to BOOST_PP_IS_EMPTY to handle this case. I'll give it a try today.

from fusion.

Kojoley avatar Kojoley commented on July 1, 2024

Huh, fusion have test with omitted arguments too

BOOST_FUSION_ADAPT_STRUCT(empty_struct,)

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 could add a check to BOOST_PP_IS_EMPTY to handle this case.

I suspect it was here but had been removed in #124

from fusion.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.