GithubHelp home page GithubHelp logo

Comments (3)

djowel avatar djowel commented on June 20, 2024

It looks like a bug with make_map. In the meantime, a workaround not using make_map, but directly using map. Something like:

#include <boost/fusion/include/make_map.hpp>
#include <boost/fusion/include/make_vector.hpp>
#include <string>

using namespace boost::fusion;

typedef map<
    pair<int, vector<>> >
map_type;

map_type m(make_pair<int>(vector<>()));

A PR is very welcome if you can investigate some more on fixing this.

from fusion.

skhrshin avatar skhrshin commented on June 20, 2024

Thanks for telling me a workaround! I could make my own make_map function using map, pair and it is working fine with make_vector.

The original make_map doesn't pass pair object to the ctor of map. That is the cause of this issue where any object whose traits::is_sequence<T>::value will be true cannot be passed. Modifying arg to fusion::pair<Key, typename detail::as_fusion_element<T>::type>(arg) will fix it, but now I wonder why arg is lvalue reference rather than forwarding reference. Maybe it's related with some compatibility issues? I haven't understood much enough to make a PR for it yet.

from fusion.

djowel avatar djowel commented on June 20, 2024

I wonder why arg is lvalue reference rather than forwarding reference

Well, actually fusion predates c++11. There are still some things need to be reworked, but care must be taken because fusion still has to support older compilers, although I am starting to think that maybe it's time to move on.

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.