On 2015-06-17 08:39, Jeremy Maitin-Shepard wrote:
Louis Dionne
writes: Roland Bock
writes: Is it acceptable to only import the `_s` string literal from Hana?
using boost::hana::literals::operator""_s; Not really. This code has to be provided by the user of the library. It
On 2015-06-15 21:08, Louis Dionne wrote: lives outside the sqlpp namespace. I cannot just tell them, to please import some string literal into their namespace.
[...] I must admit I don't have a solution. This is such a pain since it is a __joke__ in terms of implementation difficulty at the compiler/language level, but I think it is not solvable at the library level. It seems there is the obvious solution of also defining operator"" _boost_hana_s in the global namespace. I guess it is just a question of how common this problem is likely to be. Sure, but doesn't that feel like we're back in the dark ages before namespaces?
There was a nice suggestion from Tomasz on the std-proposals list [1]: <quote> [...] However I think that better syntax would be to place the qualification before literal itself, so we would get: auto hello = "hello"s; auto world = std::"world"s; auto any = std::literals::string_literals::"any"s; //If you insist on writing more and auto s = boost::hana::"sample"_s; Having prefixed qualified literal would allow to remove the limittion to use _ in user defined literals, because situation would now be same as for any other entity. </quote> Very cool suggestion :-) Best, Roland [1]: https://groups.google.com/a/isocpp.org/d/msg/std-proposals/hAnVRTlsQZY/1iBWe...