2012-03-26 154 views
10

findがstdのメンバーではないという奇妙なエラーが発生しました。エラーC2039: 'find': 'std'のメンバーではありません

エラーC2039: 'が見つかりが': '見つける':識別子が

を見つけていない基本的に、私は文字列かどうかを見つけたい 'STD'

エラーC3861のメンバーではありませんベクター内にあります

これはどうして起こりますか?コードアシストは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; 
    } 
} 
+0

グーグルを試したことはありますか?また、このコードサンプルは、コードの残りの部分がないため、コンパイルできません。将来はhttp://sscce.orgのコードサンプルを投稿してみてください。正解を与える方がはるかに簡単です。 –

答えて

29

std::find<algorithm>ヘッダで定義されています。最初に追加:

#include <algorithm> 
+0

です。これが起こる理由を教えてもらえますか? – Rudy

+10

@Rudy C++標準では、std :: findはヘッダにあると言います。 – juanchopanza

関連する問題