I want to be able to get HTTP request header values that contain utf8 characters in a server built with cpp-netlib. I understand that there are two kind of wrapper classes for requests and responses depending on the used string type - request_header_narrow
and request_header_wide
, but while browsing the code to understand how this is actually decided i came down to:
template <class Tag>
struct request_header
: mpl::if_<
is_default_string<Tag>,
request_header_narrow,
typename mpl::if_<
is_default_wstring<Tag>,
request_header_wide,
unsupported_tag<Tag>
>::type
>
{};
and
namespace boost { namespace network {
template <class Tag, class Enable = void>
struct is_default_string : mpl::false_ {};
template <class Tag>
struct is_default_string<Tag, typename enable_if<typename Tag::is_default_string>::type> : mpl::true_ {};
} // namespace network
} // namespace boost
and
namespace boost { namespace network {
template <class Tag, class Enable = void>
struct is_default_wstring : mpl::false_ {};
template <class Tag>
struct is_default_wstring<Tag, typename enable_if<typename Tag::is_default_wstring>::type> : mpl::true_ {};
} // namespace network
} // namespace boost
Since i'm not too experienced with the template meta programming stuff i did not quite understand the Boosts mpl::if_
logic and how is the default string type actually determined if both have mpl::false_
as a default value? Can anyone either clear this or explain how to make cpp-netlib use std::wstring
as default string type?