79381967

Date: 2025-01-23 17:10:51
Score: 1
Natty:
Report link

If you're using c++17 or later you can now make use of std::as_const

Class var;
int main()
{
   const double defaultAmount = [&varLocal = std::as_const(var)]{
             /*ToDo*/
    }();
}
Reasons:
  • Low length (0.5):
  • Has code block (-0.5):
  • Low reputation (1):
Posted by: user3001757