diff --git a/conanfile.py b/conanfile.py index 63dad302..ff9f1fe2 100644 --- a/conanfile.py +++ b/conanfile.py @@ -29,7 +29,7 @@ def set_version (self): if "CURRENT_VERSION" in environ: self.version = environ['CURRENT_VERSION'] else: - self.version = "v0.0.26" + self.version = "v0.0.27" def configure_cmake (self): cmake = CMake (self) diff --git a/include/data/tools/ordered_list.hpp b/include/data/tools/ordered_list.hpp index 0ae4fa5b..7d74273b 100644 --- a/include/data/tools/ordered_list.hpp +++ b/include/data/tools/ordered_list.hpp @@ -54,7 +54,7 @@ namespace data::tool { } template requires std::equality_comparable_with> - bool operator == (const X& x) const { + bool operator == (const X &x) const { return sequence_equal (*this, x); } @@ -92,8 +92,11 @@ namespace data::tool { template ordered_stack ordered_stack::insert (const element &x) const { - if (this->empty () || x < this->first ()) return {this->prepend (x)}; - return {rest ().insert (x).prepend (this->first ())}; + if (this->empty () || x < this->first ()) { + return ordered_stack {this->prepend (x)}; + } + + return ordered_stack {rest ().insert (x).prepend (this->first ())}; } } diff --git a/include/data/tools/rb_map.hpp b/include/data/tools/rb_map.hpp index a2710453..2bad53cf 100644 --- a/include/data/tools/rb_map.hpp +++ b/include/data/tools/rb_map.hpp @@ -112,6 +112,7 @@ namespace data::tool { }; // a map that is good for deriving from. + // NOTE: it seems that using this type leads to segmentation faults, not sure why. template struct base_rb_map : rb_map { using rb_map::rb_map; diff --git a/include/milewski/RBMap/RBMap.h b/include/milewski/RBMap/RBMap.h index 3b093af1..991363be 100644 --- a/include/milewski/RBMap/RBMap.h +++ b/include/milewski/RBMap/RBMap.h @@ -111,8 +111,8 @@ namespace milewski::okasaki { RBMap inserted (const K &x, const V &v) const { - RBMap t = ins(x, v); - return RBMap(B, t.left(), t.rootKey (), t.rootValue (), t.right ()); + RBMap t = ins (x, v); + return RBMap (B, t.left (), t.rootKey (), t.rootValue (), t.right ()); } template @@ -153,7 +153,8 @@ namespace milewski::okasaki { RBMap ins (const K &x, const V &v) const { - assert1(); + + assert1 (); if (isEmpty ()) return RBMap (R, RBMap (), x, v, RBMap ()); K y = rootKey ();