4 questions
3
votes
1
answer
151
views
Inconsistent output with std::any_of
I have two version of the same function using std::any_of and std::find_if for checking whether an int exist in a vector (returned from g.getEdges()).
However when I repeatedly run the std::any_of the ...
-2
votes
1
answer
464
views
memset() vs. std::fill() [duplicate]
Can anyone tell me the difference between memset() and std::fill() in c++?
I am quite confused why my code doesn't work with memset() but does with std::fill().
I am making a Sieve of Eratosthenes ...
1
vote
1
answer
222
views
Why do I need to add 'const' in the custom comparator?
I am not very familiar with C++, and am confused about how a comparator works.
The below code is how I can find the position I want to insert a new interval:
#include <algorithm>
#include <...
16
votes
7
answers
26k
views
How to use std::any_of?
I want to compare one value against several others and check if it matches at least one of those values, I assumed it would be something like
if (x = any_of(1, 2 ,3)
// do something
But the ...