How can I return from a method a web::http::status_codes value:
web::http::status_codes CMyClass::GetCode()
{
return web::http::status_codes::OK;
}
correctly ? Because in this way I got:
error C2440: 'return': cannot convert from 'const web::http::status_code' to 'web::http::status_codes'
note: No constructor could take the source type, or constructor overload resolution was ambiguous
I want to avoid return blind (unknown) int values, or, return static variables.
web::http::status_codes is defined:
typedef unsigned short status_code;
/// <summary>
/// Predefined values for all of the standard HTTP 1.1 response status codes.
/// </summary>
class status_codes
{
public:
#define _PHRASES
#define DAT(a, b, c) const static status_code a = b;
#include "cpprest/details/http_constants.dat"
#undef _PHRASES
#undef DAT
};
from cpprestsdk\include\cpprest\http_msg.h from REST_SDK ?