boiler
boiler

Reputation: 179

Compile error when using QUERY like in documentaion described

I'm following the documentation and got an error during compilation following example: https://oatpp.io/docs/components/api-controller/#query-parameters-mapping Visual Studio 2017 is complaining about C2839:invalid return type 'type' for overloaded 'operator ->' and C2232 '->' : left operand has 'class-key' type, use '.' when I try to use age like mentioned in the example.

ENDPOINT("GET", "/users", getUsers,
QUERY(Int32, age)) 
{
  OATPP_LOGD("Test", "age=%d", age->getValue());
  return createResponse(Status::CODE_200, "OK");
}

What's wrong with the usage/example?

Upvotes: 2

Views: 249

Answers (1)

boiler
boiler

Reputation: 179

Documentation is outdated, solution is:

OATPP_LOGD("Test", "age=%d", *age);

Upvotes: 4

Related Questions