clipp icon indicating copy to clipboard operation
clipp copied to clipboard

Double move/forward

Open atomicflag opened this issue 9 years ago • 2 comments

https://github.com/muellan/clipp/blob/384d10639189f1f31618f7fd825166f48b56f9e8/include/clipp.h#L1827-L1833

arg_string str and Strings&&... strs are moved/forwarded twice. Possible bug/typo?

atomicflag avatar Nov 16 '17 08:11 atomicflag

OMG - how could I not have seen this? It used to be the direct init of flags_ but then I reused the member function which also checks flags for validity (non-emptiness and flags must not contain spaces). Luckily it seems that std::string remains in a valid empty state after beeing moved from. So what apparently happens is that the flags are moved into the member flags_ and the call to the function flags doesn't add any flag, because they are empty... I will fix it soon.

muellan avatar Nov 16 '17 09:11 muellan

Fixed it with the latest commit. Thanks again!

muellan avatar Nov 16 '17 09:11 muellan