Last active
December 12, 2015 03:08
-
-
Save bkuhns/4704831 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
class my_class | |
{ | |
public: | |
struct args { | |
nullable<int> some_int; | |
nullable<float> some_float; | |
}; | |
template<typename args_func> | |
my_class(args_func get_args) | |
{ | |
args a; | |
get_args(a); | |
if (a.some_int.is_valid()) { | |
// We should probably do something to default some_int to a real value. | |
} | |
if (a.some_float.is_valid()) { | |
// ... same for some_float. | |
} | |
} | |
} | |
// [...] | |
my_class foo([](auto& a) { | |
a.some_int = 5; | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment