ulterno

joined 9 months ago
[–] ulterno@programming.dev 2 points 10 hours ago (1 children)

Same as ?

std::optional<bool> role;

if (role.value())
{ std::cerr ("User is admin");}
else if (!role.value())
{ std::cerr ("User is not admin");}
else if (!role.has_value())
{ std::cerr ("User is not logged in");}

Here has_value() should have been checked first, but the JS seems kinda fine.
Which is it?

[–] ulterno@programming.dev 1 points 3 days ago

Good that you escaped wrong, or you would have nuked your .bashrc.

  • \ comes before the thing you are escaping
  • > ⇒ overwrite from start. >> to append