Właśnie napotkałem dziwny błąd, który mówi, że find nie jest członkiem standardu.error C2039: 'find': nie jest członkiem 'std'
error C2039: 'find': nie jest członkiem 'std'
error C3861: 'find': identyfikator nie znaleziono
Zasadniczo, chcę znaleźć, czy ciąg znaków można znaleźć w wektorze
Każdy pomysł, dlaczego tak się dzieje? Asystent kodu mówi mi, że istnieje metoda w standardzie.
tak to jest w zasadzie to, co zrobiłem:
#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;
}
}
Czy próbowałeś googlować? Ponadto ten przykład kodu nie jest kompilowany, ponieważ nie miałem reszty kodu. W przyszłości spróbuj opublikować próbki kodu http://sscce.org - znacznie łatwiej jest podać poprawną odpowiedź. –