[Feature Request] Poco::format does not recognize the `P` type
As per the standard types, P is supposed to dump a pointer address (As hex reference) into the string
https://www.tutorialspoint.com/c_standard_library/c_function_sprintf.htm
But Poco::format does not (in 1.12.4 anyway !)
send a pull request with a testcase if you want this in
I think the only way this can possibly work is forcing the user to cast to void*.
Format.cpp
case 'p':
str < std::hex << std::showbase << AnyCast<void*>(*itVal++);
break;
Then the calling code would be:
int value = 0;
Poco::format("%p", static_cast<void*>(&value));
I don't believe it's possible to remove the static_cast because of the way Poco::Any works. Even if it were possible, it would require extra machinery inside Poco::Any to work.
@andrewauclair typed pointers are accessible, see testAnyPointer(), some accessors/detection has been added for 1.14. But I have no need, time or desire to add this feature and it's just creating noise - people post things then disappear, so I decided to close it
That sounds good to me. I've moved to using fmtlib myself.