This is more of an intellectual exercise, but are there battle-tested C++ libraries implementing hash map/set (std::unordered_map, std::unordered_set) ...
This is more of an intellectual exercise, but are there battle-tested C++ libraries implementing hash map/set (std::unordered_map, std::unordered_set) ...
I am using C++17. std::set is a template type: One can have a std::set as a data member. For example: One can also explicitly specify the compa ...
I am currently using a std::vector<int> vec of size nto store the integers from 0 to n-1 in any order. Suppose that the vec is given by the foll ...
I have a set of words (BELLOW, CELLO, HAAF, HABIT, HADAL, HAIR, HELLO, HELP, RABIT) stored in std::set datastructure. From the above set DS, I wan ...
I have a set containing a sortable data type. I need to be able to search to find all elements that lie between two unknown points within this set. Fo ...
This is just a continuation of several past questions. My function should return std::vector<std::set<std::string>> A group of names sho ...
I'm trying to write a function which will return vector of set type string which represent members of teams. A group of names should be classified in ...
I am trying to learn STL allocators for void*. Here is my code But I am getting Segmentation fault at Thread 1 received signal SIGSEGV, Segmentati ...
Consider: printsetofset1 with the printset(*siter); gives error: See Godbolt Link here. printsetofset0 with the lines: std::set<int> Set ...
Following code works well without issues but wondering, if it is possible to rewrite custom comparison operator using boost::iequals , which compares ...
Sample code: Invocations: Question: why msvc requires const while others don't? Or why others don't require const? ...
STL set can have customized comparator. It can be implemented in several ways, such as define an operator(), use decltype on lambda, etc. I was trying ...
I've a some class where I'm declaring a set like this: I'm trying to use std::less compare function on it. I tried something like this: The feed ...
This must be something incredibly stupid, yet I can't manage to make head or tail from it. This is the testing code. I've tried overloading the ope ...
I have a std::vector of std::variant elements with type int or std::set<int>. I want to loop over this vector and insert an extra item if the it ...
so essentially I have a set of instances of struct A. I want to extract an instance, modify the fields. One of the fields is a unique ptr. I'm not tha ...
I created a set via where my comp_double function is given by I inserted two dummy elements, values.insert(0.01) and values.insert(0.02), but th ...
How can the unordered_set can hold both (0, 1) and (1, 0) if they have the same hash value? #include <iostream> #include <unordered_set> ...
I have a set of pointers and I want the set to be sorted in a specific order. I came up with this code and it works as expected: What bothers me i ...
I've looked through a lot of posts that get the same error, but couldn't find one that applied to my problem, apologies if this is a duplicate regardl ...