Skip to content

Instantly share code, notes, and snippets.

View Fiona-J-W's full-sized avatar

Fiona Johanna Weber Fiona-J-W

View GitHub Profile
/*
* Random-Number Utilities (randutil)
* Addresses common issues with C++11 random number generation.
* Makes good seeding easier, and makes using RNGs easy while retaining
* all the power.
*
* The MIT License (MIT)
*
* Copyright (c) 2015 Melissa E. O'Neill
*
@Fiona-J-W
Fiona-J-W / gist:5834452
Last active December 18, 2015 19:39 — forked from anonymous/gist:5834419
template<Strategy>
class Algorithm {
friend class ConcreteStrategy;
public:
Algorithm(ConcreteStrategy strategy) : strategy{strategy} {
strategy.set_algorithm(this);
}
void onEvent(Event x) {
this->strategy.onEvent(x);