Skip to content

Instantly share code, notes, and snippets.

@deque-blog
Last active April 1, 2017 14:49
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save deque-blog/c5d19b10ac545e5a54ddf4c599cab5fb to your computer and use it in GitHub Desktop.
Save deque-blog/c5d19b10ac545e5a54ddf4c599cab5fb to your computer and use it in GitHub Desktop.
auto int_pair_gen = make_tuple_gen(int_gen(100), int_gen(1000));
auto inputs_gen = make_vector_gen(50000, int_pair_gen);
auto less_on_second = ordering_by_index<1>();
//Generate a vector of up to 50k elements
auto input = inputs_gen(gen);
//To test our sorting routine
auto sorted = input;
custom_sort(begin(sorted), end(sorted), less_on_second);
//Check the property of unstable sort
check_sort_property(input, sorted, less_on_second);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment