MKFAHttpRequest Request( std::string( Buffer ) );
This line doesn't do what you think it does. You think it defines an object named Request
of type MKFAHttpRequest
and initializes the object with a temporary object of type std::string
.
In fact, it declares a function named Request
which accepts a single parameter of type std::string
and returns an object of type MKFAHttpRequest
.
This is related to (or perhaps an example of) the most vexing parse.
Perhaps one of these will make it better:
MKFAHttpRequest Request( (std::string( Buffer )) );
MKFAHttpRequest Request{ std::string( Buffer ) };
MKFAHttpRequest Request = std::string( Buffer );
MKFAHttpRequest Request = MKFAHttpRequest(std::string( Buffer ));