New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Compilation error when using g++ v6.3.0 c++11 #118

Open
davidoz99 opened this Issue Jan 30, 2018 · 0 comments

Comments

Projects
None yet
1 participant
@davidoz99

davidoz99 commented Jan 30, 2018

Hi All,

This is just a heads up for anyone compiling the http server using a new-ish gcc compiler. My v6.3.0 g++ compiler generates an error in method:

bool webserver::register_resource(const std::string& resource, http_resource* hrm, bool family)

It is unable to copy the details::http_endpoint object when it is inserted into the registered_resources map. It looks like the compiler is using different STL classes to do the copying and destroying than the ones before. Unlike std::pair, these other classes are not friends of details::http_endpoint.

To temporarily workaround the issue I simply made the copy and destructor methods of details::http_endpoint public.

public:
        http_endpoint(const http_endpoint& h);
        ~http_endpoint();
private:
    ....

When the newer compilers are supported, a permanent solution will need to identify which new STLs are interacting with details::http_endpoint so they can also be made friends. It might be std::tuple and/or std::forward(), but I'm not completely sure.

Thanks.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment