These are chat archives for boostorg/hana

6th
Apr 2017
Jason Rice
@ricejasonf
Apr 06 2017 15:58
@ldionne With my PR I was having a lot of chicken/egg problems with includes. I went to add an example file, and I get this.
In file included from /usr/local/src/hana/example/index_if.cpp:6:
In file included from /usr/local/src/hana/include/boost/hana/core/is_a.hpp:15:
In file included from /usr/local/src/hana/include/boost/hana/bool.hpp:17:
In file included from /usr/local/src/hana/include/boost/hana/core/to.hpp:16:
In file included from /usr/local/src/hana/include/boost/hana/concept/foldable.hpp:19:
In file included from /usr/local/src/hana/include/boost/hana/fold_left.hpp:20:
In file included from /usr/local/src/hana/include/boost/hana/unpack.hpp:26:
In file included from /usr/local/src/hana/include/boost/hana/pair.hpp:20:
/usr/local/src/hana/include/boost/hana/detail/operators/comparable.hpp:33:18: error: function
      'operator()<boost::hana::optional<boost::hana::integral_constant<unsigned long, 0> >, const
      boost::hana::integral_constant<unsigned long, 0> &>' with deduced return type cannot be used before
      it is defined
        { return hana::equal(static_cast<X&&>(x), static_cast<Y&&>(y)); }
I got these a lot, but apparently band-aiding it doesn't make the problem go away
Jason Rice
@ricejasonf
Apr 06 2017 16:09
This time it doesn't appear to be with any files that I changed.
hia3
@hia3
Apr 06 2017 16:15
Hi guys! I'm getting this error from AddressSanitizer (clang, windows, boost1.63) - "runtime error: constructor call on address <some address> with insufficient space for an object of type 'boost::hana::detail::elt<1, boost::hana::type_impl<my_struct>::_, true>'". Any idea why this happening?
Louis Dionne
@ldionne
Apr 06 2017 16:16
I would bet this has to do with a ASan bug, but I’d need to see the code to be sure.
@ricejasonf Did you fix your problem now? It seems like the tests are passing on the PR, so I’m not sure what includes problem you’re seeing.
Jason Rice
@ricejasonf
Apr 06 2017 16:17
I was missing an example file that I referenced in the documentation. I haven't pushed it yet because of the above error
Louis Dionne
@ldionne
Apr 06 2017 16:18
I see. Please send a gist to the example
I’ll have a quick look
OH.
No need, I know what the issue is.
I’d bet you’re missing an include of hana/equal.hpp, and/or hana/integral_constant.hpp
Are you using operator== somewhere in your example? Probably, right?
Jason Rice
@ricejasonf
Apr 06 2017 16:19
oh, lemme see
yep that fixed that
Louis Dionne
@ldionne
Apr 06 2017 16:20
You see, that’s magic.
Thanks a lot for the PR, it looks great.
Louis Dionne
@ldionne
Apr 06 2017 16:33
@hia3 If you can post a Gist, it’ll be easier to help you
Jason Rice
@ricejasonf
Apr 06 2017 17:20
I think any_of for iterables could also be simplified to use index_if, but I figured that was a bridge too far for this PR.
hmm... should I add that?
@ldionne ^
Jason Rice
@ricejasonf
Apr 06 2017 17:29
I think it would replace any_of for both Iterable and Sequence
Jason Rice
@ricejasonf
Apr 06 2017 17:37
There are no tests for any_of on Iterable && !Sequence
Jason Rice
@ricejasonf
Apr 06 2017 18:45
I also think specializations like any_of<T[N]> are no longer needed. I might try ripping those out too
Louis Dionne
@ldionne
Apr 06 2017 18:45
@ricejasonf I would say replacing any_of is for another PR. And if you want to add tests, that would be neat. I guess I was too lazy to do it :(
I would love that if it’s possible, but please try to do those in a separate CR to make the review easier.
Jason Rice
@ricejasonf
Apr 06 2017 18:45
k
I'm getting a weird error with it anyways.
Jason Rice
@ricejasonf
Apr 06 2017 18:50
On metaben.ch, why does find_if appear to be faster than at?
Even hana::at_key on hana::map appears to be faster than hana::at on hana::tuple. I must be reading it wrong.
Louis Dionne
@ldionne
Apr 06 2017 19:04
Ehhh you’re right.
Might be a genuine performance bug
Need to check.
Opened issue: boostorg/hana#330
Jason Rice
@ricejasonf
Apr 06 2017 21:42
ack.. I added my name to basic_tuple.hpp but then I moved the implementation to index_if.hpp :(
Louis Dionne
@ldionne
Apr 06 2017 23:08
@hia3 Can you post the command line you’re using, please?