These are chat archives for boostorg/hana

11th
Jul 2016
Jason Rice
@ricejasonf
Jul 11 2016 16:59
This is just a thought, but perhaps a hana::typeof_equal would be a useful feature, and then maybe even a hana::enable_if_typeof_equal would be handy for SFINAE with matching components of implementation defined types.
Louis Dionne
@ldionne
Jul 11 2016 17:05
What would be the semantics of typeof_equal?
Jason Rice
@ricejasonf
Jul 11 2016 17:30
hana::typeof_equal(x, 5) == hana::equal(hana::typeof(x), hana::typeof(5))
more of a convenience than anything
Louis Dionne
@ldionne
Jul 11 2016 17:31
So hana::on(hana::equal, hana::typeof)
I’m reluctant to add too many conveniences, because the library should try to stay generally useful without becoming bloated.
If there’s a vast array of use cases where this would be useful, though, it might be considered generally useful.
Jason Rice
@ricejasonf
Jul 11 2016 17:35
alright I'll perhaps get back to you on it then if I still think it is generally useful.
Louis Dionne
@ldionne
Jul 11 2016 17:39
If you think it’s worth it, just create an issue with your use cases and we’ll talk.
Jason Rice
@ricejasonf
Jul 11 2016 17:39
k
I'm looking forward to using typeof :)
Louis Dionne
@ldionne
Jul 11 2016 17:40
One thing that I’m worried about; there’s a GNU extension called typeof, I think.
I don’t want it to clash.
Jason Rice
@ricejasonf
Jul 11 2016 17:43
yikes. Does that behave the same as decltype?
Louis Dionne
@ldionne
Jul 11 2016 17:57
I think it does, but it was pre C++11
Jason Rice
@ricejasonf
Jul 11 2016 18:05
Personally, I'm cool with either name.
Louis Dionne
@ldionne
Jul 11 2016 18:06
ok. I’ll check whether it conflict and decide.
Jason Rice
@ricejasonf
Jul 11 2016 18:07
the typeof test passes on my gcc 6.1.1 if that helps
maybe it's just me, but make check with gcc seems... slower :P
Louis Dionne
@ldionne
Jul 11 2016 18:09
the typeof test passes on my gcc 6.1.1 if that helps
I know, but that could be because extensions are not enables

maybe it's just me, but make check with gcc seems… slower

Yeah, GCC is somewhat slower

Jason Rice
@ricejasonf
Jul 11 2016 18:17
gcc-typeof.cpp:4:13: error: expected type-specifier before ‘typeofusing Y = typeof(x);
I have to use __typeof__ to get it to work. I'm not sure how to enable it.
Jason Rice
@ricejasonf
Jul 11 2016 18:35
ah
Louis Dionne
@ldionne
Jul 11 2016 18:36
Yeah… That sucks. It would kinda suck to break people’s code that way.
Or rather to have Hana not work with this GCC option (which is the default I think)
Jason Rice
@ricejasonf
Jul 11 2016 18:37
good catch though
Louis Dionne
@ldionne
Jul 11 2016 18:38
This extension is arguably broken, since one can’t define a typeof function at all when using it.