Code Monkey home page Code Monkey logo

Comments (3)

ricejasonf avatar ricejasonf commented on June 11, 2024

I think the reason types can't be a Sequence is that any implementation of make would lose the run-time information for all of the elements.

For example this would fail:

static_assert(hana::front(hana::make<types_tag>(1, '2', 3.3)) == 1, "");

from hana.

catskul avatar catskul commented on June 11, 2024

Given the concept of the types container, the expectation is that I cannot hold runtime info, right? It would seem, from my naive perspective, that it should be possible to cleanly disable certain actions without disabling the use of the types container completely.

But perhaps I'm missing a critical insight.

At least conceptually, it's both possible and desirable to be able to sort a type container.

from hana.

ricejasonf avatar ricejasonf commented on June 11, 2024

It's also possible and desirable to sort a std::vector😛, but for that you would not use hana::sort which works with objects that satisfy hana::Sequence.

I don't know that it is explicitly forbidden. You still have to implement the functions required to make it a Sequence. Here is an example I posted on how to do that: https://stackoverflow.com/a/61879631/800347

I do remember barking up this tree myself and getting shot down. In any case, Boost.Hana is optimized for heterogeneously typed containers that contain run-time information so it is slow for type-only computations compared to libraries such as Boost.Mp11. (It has a sort function.)

from hana.

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.