These are chat archives for boostorg/hana

31st
Jan 2016
Louis Dionne
@ldionne
Jan 31 2016 15:50
You are right. We would need to make the HashMap a template parameter.
I’ll try that.
I guess I just had to try it to see it, but that was a good remark from you.
Louis Dionne
@ldionne
Jan 31 2016 17:22
@ricejasonf I just implemented the new insert function in boostorg/hana@59187bd.
But it could still be improved as the TODO says, though.
Jason Rice
@ricejasonf
Jan 31 2016 17:38
no default constructor? 😱
Louis Dionne
@ldionne
Jan 31 2016 17:40
lol
Thats #197. Plus, with the new hash table stuff, would it make any sense to default-construct a map? How would you do that?
The only way I would see is something like using Map = decltype(hana::make_map(…)) and then Map{}, but that’s a questionable use.
Jason Rice
@ricejasonf
Jan 31 2016 18:24
I have a facade layer that contains multiple maps some of which are default constructible.
template<typename Map>
struct SomeFacade {
    Map map;
};

template<typename Map>
struct SomeFacade {
    Map map;

    SomeFacade()
        : map(/*uhhhh*/)
    { }
};

template<typename TupleOfPairs>
struct SomeFacade {
    using Map = decltype(hana::unpack(TupleOfPairs{}, hana::make_map));
    Map map;

    SomeFacade()
        : map(hana::unpack(TupleOfPairs{}, hana::make_map))
    { }
};
Louis Dionne
@ldionne
Jan 31 2016 19:05
Ok, you got me. I’m going to make hana::map default constructible, for there shouldn’t be a reason for it not to be if all the keys and all the values are default constructible.
So if you manage to put your hands on a hana::map type, you can default-construct it if you so desire.
Jason Rice
@ricejasonf
Jan 31 2016 20:50
yay! sorry if i that came off as pushy 😁