Skip to content

Instantly share code, notes, and snippets.

View ericniebler's full-sized avatar

Eric Niebler ericniebler

View GitHub Profile
@ericniebler
ericniebler / insertion_sort.cpp
Last active August 29, 2015 14:07
insertion_sort benchmark for counted iterables
#include <chrono>
#include <iostream>
// From https://github.com/ericniebler/range-v3 :
#include <range/v3/range.hpp>
class timer
{
private:
std::chrono::high_resolution_clock::time_point start_;
public:
@ericniebler
ericniebler / slide.cpp
Last active May 4, 2016 04:53
a counted range, and slide working with counted and non-counted iterators
#include <vector>
#include <utility>
#include <iostream>
#include <algorithm>
#include <range/v3/range.hpp>
using namespace ranges;
template<typename It>
class counted_range : public range_facade<counted_range<It>>
{