pistacheio / pistache

A high-performance REST toolkit written in C++
https://pistacheio.github.io/pistache/
Apache License 2.0
3.12k stars 690 forks source link

Troublesome SegmentTreeNode code #1094

Open DarkMaguz opened 1 year ago

DarkMaguz commented 1 year ago

I have been trying to use instances of SegmentTreeNode in a multimap but have reached an impasse. Can't quite figure out if I'm trying to do something that shouldn't be done or if it's a genuine bug.

I have written a gtest here that demonstrates the issue. I would have expected both tests to pass. The 'postbuild' test works as expected, however the 'prebuild' test does not.

Given the scenario where a middleware-function is testing if a given resource should require authorization, a prebuild cashe of SegmentTreeNode instances would arguably be faster.