Подтвердить что ты не робот

Ошибка C2039: 'find': не является членом 'std'

Я просто столкнулся с странной ошибкой, в которой говорится, что find не является членом std.

ошибка C2039: 'find': не является членом 'std'

ошибка C3861: 'find': идентификатор не найден

В принципе, я хочу найти, можно ли найти строку в векторе

Любая идея, почему это происходит? код помогает мне, что есть метод find в std.

так что это в основном то, что я сделал:

#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;
   }
}
4b9b3361

Ответ 1

std::find определяется в заголовке <algorithm>. Добавить в начало:

#include <algorithm>