Stiffstream / restinio

Cross-platform, efficient, customizable, and robust asynchronous HTTP(S)/WebSocket server C++ library with the right balance between performance and ease of use
Other
1.15k stars 93 forks source link

Can't compile REStinio using VS2015 #74

Closed cedriclaplace closed 4 years ago

cedriclaplace commented 4 years ago

We were planning to try out RESTinio to implement REST servers but we are facing a problem. We can't compile it using VS2015, according to your documentation it should be fine.

It looks like there is a bug in the compiler which does not support defaulted constexpr assignment operators, we are going to repport this problem to Microsoft. We don't think this problem is specific to RESTinio because it can be reproduce easily with a basic class and everything is fine with VS2017/2019. We would like to know if you have encoutered this kind of problem ?

The problem occured while trying to compile the file restinio/http_headers.hpp containing the class http_method_id_t:

class http_method_id_t
{
    ...

    constexpr http_method_id_t( const http_method_id_t & ) noexcept = default;
    constexpr http_method_id_t &
    operator=( const http_method_id_t & ) noexcept = default;

    constexpr http_method_id_t( http_method_id_t && ) noexcept = default;
    constexpr http_method_id_t &
    operator=( http_method_id_t && ) noexcept = default;

    ...

The following error is raised when compiling:

E:\dev\external\include\restinio/http_headers.hpp(1496): error C2610: 'restinio::http_method_id_t &restinio::http_method_id_t::operator =
(const restinio::http_method_id_t &) noexcept const': is not a special member function which can be defaulted
E:\dev\external\include\restinio/http_headers.hpp(1500): error C2610: 'restinio::http_method_id_t &restinio::http_method_id_t::operator =
(restinio::http_method_id_t &&) noexcept const': is not a special member function which can be defaulted

To reproduce the problem, simply create a basic project using VS2015 compiler (can be done through CMake or VS) and try to compile one of the basic examples given on your repository homepage.

Regards.

eao197 commented 4 years ago

We can't compile it using VS2015, according to your documentation it should be fine.

I'm afraid the problem is outdated documentation. We didn't check RESTinio with VS2015 for a very long time and don't plan to support this old version of the C++ compiler with poor support of the C++14 standard.

cedriclaplace commented 4 years ago

That's OK. The purpose of this post was to inform you about this situation.