Last active
February 9, 2017 01:48
-
-
Save U007D/a966323ff607f5adda8cb4eba6d48da7 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#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