-
-
Notifications
You must be signed in to change notification settings - Fork 33
dlib.core.compound
Timur Gafarov edited this page Apr 26, 2017
·
2 revisions
Tuple/struct hybrid. This simple template can be used to construct data types on-the-fly and return them from functions, which cannot be done with pure tuples. One possible use case for such types is returning result and error message from function instead of throwing an exception (this is how error handling is done in Go).
A struct that consists of a tuple T. Allows square bracket access to the members of a tuple.
-
T tuple
- underlying tuple.
-
Compound!(T) compound(T...)(T args)
- returns aCompound
consisting ofargs
.
auto c = compound(true, 0.5f, "hello");
assert(c[0] == true);
assert(c[1] == 0.5f);
assert(c[2] == "hello");