Ad
  • Custom User Avatar

    This is just an old answer, so its had a long time to slowly accumulate votes. There's no generic upvote, you either vote for best practice or clever, and this is definitely NOT clever.

    It's also rust, which very few people truly understand (certainly including me) so many people don't know what they're looking at.

    That being said, I haven't ever used C and C++ only like 15 years ago, so this is more just general procedural language not really C/C++. But yeah, there are definitely more concise ways of doing this in rust, considering it's awesome methods on iterables.