boostorg / url

Boost.URL is a library for manipulating Uniform Resource Identifiers (URIs) and Locators (URLs).
https://www.boost.org/doc/libs/master/libs/url/index.html
Boost Software License 1.0
185 stars 50 forks source link

Const integer makes format fail #793

Closed LarsGullik closed 11 months ago

LarsGullik commented 11 months ago

If a const integer is passed to format then compilation fails.

#include <boost/url/format.hpp>

struct HostPort {
    const std::string_view host{"a.host"};
    //const unsigned short int port{80}; // does not compile
    unsigned short int port{80}; // compiles
};

int main()
{
    HostPort hp;
    auto url = boost::urls::format("http://{}:{}", hp.host, hp.port);
}

Ref. https://godbolt.org/z/EdrY9cvnG

There seems to be some missing std::remove_cv somewhere.