These are chat archives for boostorg/hana

30th
Oct 2015
Jason Rice
@ricejasonf
Oct 30 2015 21:17
Is there a reason that BOOST_HANA_STRING is not constexpr? I see that it uses a lambda.
I don't even know if I need it to be constexpr. I'm just curious.
Louis Dionne
@ldionne
Oct 30 2015 21:23
Lambdas can’t appear in constant expressions. That’s a restriction of the language that will most likely be lifted in C++17.
Jason Rice
@ricejasonf
Oct 30 2015 21:46
yeah i was just curious why it's used in the string macro
Louis Dionne
@ldionne
Oct 30 2015 21:52
@ricejasonf You mean why a lambda is used?
Jason Rice
@ricejasonf
Oct 30 2015 21:52
yes
Louis Dionne
@ldionne
Oct 30 2015 21:52
Because there’s no (known) way of doing it otherwise.
Jason Rice
@ricejasonf
Oct 30 2015 21:52
aha
Louis Dionne
@ldionne
Oct 30 2015 21:53
Creating compile-time strings without the GNU extension (the one with the _s user-defined literal) is only possible with this technique. Or you can also spell-out your compile-time string manually: hana::string<‘h’, ‘e’, ‘l’, ‘l’, ‘o’>.
Jason Rice
@ricejasonf
Oct 30 2015 21:58
ty. cool project btw
Louis Dionne
@ldionne
Oct 30 2015 21:59
No problem. Thanks for your interest in it!