Compile error when using QUERY like in documentaion described

205 Views Asked by At

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?

1

There are 1 best solutions below

0
boiler On BEST ANSWER

Documentation is outdated, solution is:

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