mirror of
https://github.com/ToruNiina/toml11.git
synced 2025-12-16 03:08:52 +08:00
The 'result' class has unwrap() and unwrap_err() member functions overloaded for const lvalue and rvalue *this to avoid an unnecessarily copying the to-be unwrapped object of its containing object is going to be discarded anyway. Alas, the parse() function toml/parser.hpp file stored the parse result in a local `const` variable so, although the unwrap call would have been the last use of the object in each case, the unnecessary copy would still be made. This patch removes the `const` and adds a std::move() to actually benefit from the already implemented optimization.
96 KiB
96 KiB