I just encountered a weird error which saying that find is not a member of std.
error C2039: 'find' : is not a member of 'std'
error C3861: 'find': identifier not found
Basically, I want to find whether a string can be found in the vector
Any idea why does this happen? the code assist tells me that there is find method in std.
so this is basically what I did :
#include "OperatorUtil.h"
#include <iostream>
#include <string>
#include <stdlib.h>
#include <math.h>
#include <sstream>
using namespace saeConfig;
namespace operatorUtil
{
bool isIn(const Filter filter, const SearchKey key)
{
bool result = false;
string dimensionStr = key.dimensions.getValue(filter.getFilterKey());
if(filter.getFilterValues().size()>0)
{
vector<string> vstr= filter.getFilterValues();
std::vector<string>::iterator it; // Iterator
it = std::find(vstr.begin(), vstr.end(), dimensionStr); //ERROR LINE
// Check do we have the object in the queue
if(it == vstr.end())
{
result =true;
}
}
return result;
}
}
std::find
is defined in the <algorithm>
header. Add to the beginning:
#include <algorithm>
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With