Opened 5 years ago
Last modified 5 years ago
#13318 new Bugs
key_of_value now changes the type in the priority comparison for intrusive::treap_set
Reported by: | Owned by: | Ion Gaztañaga | |
---|---|---|---|
Milestone: | To Be Determined | Component: | intrusive |
Version: | Boost 1.65.0 | Severity: | Regression |
Keywords: | Cc: |
Description
Setting the key_of_value
option now changes the type used in the priority comparison, which makes it impossible to use key_of_value
when the priority is entirely separate to the primary key.
The example below uses a comparison functor; a similar problem occurs with priority_compare(T const&, T const&)
function.
This worked in 1.59, fails to compile in 1.65.1.
#include <boost/intrusive/treap_set.hpp> using namespace boost::intrusive; struct Test : public bs_set_base_hook<> { Test(int k, int p) : m_key(k), m_priority(p) {} int m_key; int m_priority; }; struct TestKey { using type = int; int const& operator()(Test const& t) const { return t.m_key; } }; struct PriorityCompare { bool operator()(Test const& t1, Test const& t2) const { return t1.m_priority < t2.m_priority; } }; using Container = treap_set<Test, key_of_value<TestKey>, priority<PriorityCompare>>; int main() { Test t1(1, 2); Container c; c.insert(t1); }
Note:
See TracTickets
for help on using tickets.
For reference, this is the error message produced. The compiler is Clang from Xcode 9.