GithubHelp home page GithubHelp logo

Is there a identity_view? about fusion HOT 8 CLOSED

boostorg avatar boostorg commented on July 19, 2024
Is there a identity_view?

from fusion.

Comments (8)

djowel avatar djowel commented on July 19, 2024

No, there is no identity_view. Would you like to contribute one?

from fusion.

djowel avatar djowel commented on July 19, 2024

The easiest way is to use transform_view.

from fusion.

denzor200 avatar denzor200 commented on July 19, 2024

Yes, transform_view is a good idea. But it's view has no at_key_impl, key_of_impl, and so others for associative sequence.
Respectively, if we get boost::fusion::map and wrap it into transform_view, then our map will lose its associative character.

Is that intended, or is this a flaw on the transform_view side?

from fusion.

denzor200 avatar denzor200 commented on July 19, 2024

@djowel I implemented this in a rather cheeky way 😄
https://godbolt.org/z/3qn4x8ns5

from fusion.

djowel avatar djowel commented on July 19, 2024

Is that intended, or is this a flaw on the transform_view side?

It is not documented (*), but the ideal behavior would be that views should inherit the properties of its subjects. Again, PR would be great. It seems you have familiarity with fusion.

(* https://www.boost.org/doc/libs/1_65_1/libs/fusion/doc/html/fusion/view.html)

from fusion.

denzor200 avatar denzor200 commented on July 19, 2024

Again, PR would be great. It seems you have familiarity with fusion.

PR in process.. I started with the tests. The way I see it:
https://godbolt.org/z/3Y93n3dvd

I propose to make a set of generic tests that will be check any Sequence for compliance with the Concept.
Now in the fusion, view tests are absolutely not scalable:(

from fusion.

denzor200 avatar denzor200 commented on July 19, 2024

My example above show already implemented test for ForwardSequence concept.
filter_view passed this test good. But the current filter_view will fail test for AssociativeSequence concept, i suppose

from fusion.

denzor200 avatar denzor200 commented on July 19, 2024

13593be

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.