diff --git a/src/HttpParser.h b/src/HttpParser.h index 0593b3eec..64b35c56f 100644 --- a/src/HttpParser.h +++ b/src/HttpParser.h @@ -43,11 +43,11 @@ static void *FULLPTR = (void *)~(uintptr_t)0; /* STL needs one of these */ template -std::optional maybeify(T *ptr) { - return ptr ? ptr : std::nullopt; +std::optional optional_ptr(T *ptr) { + return ptr ? std::optional(ptr) : std::nullopt; } -static const size_t MAX_FALLBACK_SIZE = atoi(maybeify(getenv("UWS_HTTP_MAX_HEADERS_SIZE")).value_or("4096")); +static const size_t MAX_FALLBACK_SIZE = atoi(optional_ptr(getenv("UWS_HTTP_MAX_HEADERS_SIZE")).value_or("4096")); struct HttpRequest {