Skip to content

Instantly share code, notes, and snippets.

@deque-blog

deque-blog/Shape.cpp

Last active Sep 13, 2017
Embed
What would you like to do?
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
You can’t perform that action at this time.