id,summary,reporter,owner,description,type,status,milestone,component,version,severity,resolution,keywords,cc 11994,Support intrusive container key extractors that return the key by value,fdegros@…,Ion Gaztañaga,"[http://www.boost.org/doc/libs/1_60_0/doc/html/intrusive/map_multimap.html Map and multimap-like interface for associative containers] specifies that the ""key extractor"" passed by `key_of_value` must provide a member function to obtain a const reference to the key stored inside a `value_type`. According to my experience, if the key extractor returns the key by value instead of const reference, then the code compiles but the program crashes a run time. This is a real pitfall. Consider supporting key extraction by value as well. It would allow to use keys that are not stored directly in the value_type, or not directly accessible by reference. For example: {{{#!c++ using boost::intrusive; struct my_node: set_base_hook<> { string s; }; // The key is the length of my_node::s. struct by_length { using key_type = std::size_t; // Return key by value. std::size_t operator()(const my_node& n) const { return n.s.length(); } }; multiset> v; v.insert(...); // Find a string by length. const auto it = v.find(3); ... }}} If this is not possible, then add a static assertion to make sure that the code doesn't compile at all.",Bugs,closed,To Be Determined,intrusive,Boost 1.60.0,Problem,fixed,,