GSL/include
saurabh singh 437791e504 GSL::finally can make use of move semantics
for eg consider this case
[code]
string value = "someVeryLongErrorMessageIAm";
finally([value] { PrintErrorMessage(value); }
[/code]
With the current changes before the call to PrintErrorMessage there will be 3 calls to copy constructor for string(1 when it's captured in closure, 2nd when finally is called and 3rd when it's passed to Final_act . With my patch there will be 1 call to the copy constructor and 2 to the move constructor for the scenario in example, so 2 potential deep copies will be saved for some objects.
Validated that code builds from root, and all tests pass after my change. Also validated that indeed copy constructor calls are saved for objects that support move semantics.
2015-09-27 16:11:12 +05:30
..
array_view.h Fix issue #39: Add header guards 2015-09-24 18:08:34 -07:00
fail_fast.h Fix issue #39: Add header guards 2015-09-24 18:08:34 -07:00
gsl.h GSL::finally can make use of move semantics 2015-09-27 16:11:12 +05:30
string_view.h Fix issue #39: Add header guards 2015-09-24 18:08:34 -07:00