educelab / volume-cartographer

Volumetric processing toolkit and C++ libraries for the recovery and restoration of damaged cultural materials
GNU General Public License v3.0
63 stars 22 forks source link

(String) Fix partition returning wrong middle value #87

Closed csparker247 closed 4 months ago

csparker247 commented 4 months ago

Fixes bug where partition would return an incorrect middle value. The following example now runs correctly:

auto [pre, mid, post] = partition("key=value", "=");

assert(pre == "key");
assert(mid == "="); // before, assertion error because mid is "=val" 
assert(post == "value");