79491364

Date: 2025-03-07 05:45:16
Score: 0.5
Natty:
Report link

STL offers std::to_address under <memory> for this purpose starting in C++ 20. Looking at the implementation for MSVC, it seems to revolve around manually calling operator->, so this could be another option in older language versions. This has the advantage of also working with raw pointers, useful in template scenarios where the exact pointer type can vary.

Reasons:
  • Has code block (-0.5):
  • Single line (0.5):
  • Low reputation (0.5):
Posted by: TheBoxyBear