Skip to main content
Minor grammatical fix
Source Link
Toby Speight
  • 88.3k
  • 14
  • 104
  • 327

As lubgr mentioned, it's worth using an initializer list. If we want to avoid copying (if the inputs are large, or can't be copied), then we'll want to use a initializer-list of reference wrappers, and use std::min_element() (since the initializer-list std::min() returns a copy). That can be achieved like this:

As lubgr mentioned, it's worth using an initializer list. If we want to avoid copying (if the inputs are large, or can't be copied), then we'll want to use a initializer-list of reference wrappers, and use std::min_element() (since the initializer-list std::min() returns a copy. That can be achieved like this:

As lubgr mentioned, it's worth using an initializer list. If we want to avoid copying (if the inputs are large, or can't be copied), then we'll want to use a initializer-list of reference wrappers, and use std::min_element() (since the initializer-list std::min() returns a copy). That can be achieved like this:

Commonmark migration
Source Link
Whinge about missing tests
Source Link
Toby Speight
  • 88.3k
  • 14
  • 104
  • 327

I suggest that when you present code for review, you include the tests, too - I imagine that your testing is much more thorough than mine, and I'm too lazy to re-create the full suite. It also helps reviewers identify scenarios that are missing from the tests (or, conversely, scenarios that are redundant).


I recommend using perfect forwarding for the comparator:

I recommend using perfect forwarding for the comparator:

I suggest that when you present code for review, you include the tests, too - I imagine that your testing is much more thorough than mine, and I'm too lazy to re-create the full suite. It also helps reviewers identify scenarios that are missing from the tests (or, conversely, scenarios that are redundant).


I recommend using perfect forwarding for the comparator:

Forward 'less' in second version
Source Link
Toby Speight
  • 88.3k
  • 14
  • 104
  • 327
Loading
Source Link
Toby Speight
  • 88.3k
  • 14
  • 104
  • 327
Loading