Skip to content

Instantly share code, notes, and snippets.

@deque-blog
Last active September 13, 2017 11:10
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/7d8c05b49d49807c9ab7222aa5f78215 to your computer and use it in GitHub Desktop.
Save deque-blog/7d8c05b49d49807c9ab7222aa5f78215 to your computer and use it in GitHub Desktop.
template<class Coordinate>
using Shape = std::function<bool (Coordinate const&)>;
using Coord2D = std::pair<double, double>;
using Shape2D = Shape<Coord2D>;
template<class Coordinate>
Shape<Coordinate> outside(Shape<Coordinate> const& s) {
return [=](Coordinate const& coord) {
return not s(coord);
};
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment