Skip to content

Instantly share code, notes, and snippets.

@U007D
Last active February 9, 2017 01:48
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 U007D/a966323ff607f5adda8cb4eba6d48da7 to your computer and use it in GitHub Desktop.
Save U007D/a966323ff607f5adda8cb4eba6d48da7 to your computer and use it in GitHub Desktop.
#include <iostream>
using namespace std;
using Range = std::pair<double, double>;
using Range2D = std::pair<Range, Range>;
inline Range2D MakeIt(double xMin, double xMax, double yMin, double yMax)
{
return Range2D(Range(xMin, xMax), Range(yMin, yMax));
}
inline Range2D MakeIt(double min, double max)
{
return MakeIt(min, max, min, max);
}
class Foo
{
public:
Foo(Range2D range2D)
{
range2D_ = range2D;
}
Range range2D_;
};
int main() {
auto foo = Foo(MakeIt(1, 2));
cout << foo.range2D_.first << endl;
return 0;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment