Namespace containing C++14 user-defined literals provided by Hana. More...
Functions | |
template<char ... c> | |
constexpr auto | operator""_c () |
Creates a hana::integral_constant from a literal. More... | |
template<typename CharT , CharT ... s> | |
constexpr auto | operator""_s () |
Creates a compile-time string from a string literal. More... | |
Namespace containing C++14 user-defined literals provided by Hana.
constexpr auto boost::hana::literals::operator""_c | ( | ) |
Creates a hana::integral_constant
from a literal.
The literal is parsed at compile-time and the result is returned as a llong<...>
.
llong<...>
instead of ullong<...>
because using an unsigned type leads to unexpected behavior when doing stuff like -1_c
. If we used an unsigned type, -1_c
would be something like ullong<-1>
which is actually ullong<something huge>
.constexpr auto boost::hana::literals::operator""_s | ( | ) |
Creates a compile-time string from a string literal.
The string literal is parsed at compile-time and the result is returned as a hana::string
. This feature is an extension that is disabled by default; see below for details.
BOOST_HANA_CONFIG_ENABLE_STRING_UDL
config macro is required to get this operator. Hence, if you want to stay safe, just use the BOOST_HANA_STRING
macro instead. If you want to be fast and furious (I do), define BOOST_HANA_CONFIG_ENABLE_STRING_UDL
.References boost::hana::value.