私はこのようにで使用しようとしていupper_bound
ますvector<pair<int,int>>
:
vector<pair<int,int>> data;
auto up = upper_bound(data.begin(), data.end(), 0);
VS2012 で次のエラーが表示されます。
error C2784: 'bool std::operator <(const std::vector<_Ty,_Alloc> &,const std::vector<_Ty,_Alloc> &)' : could not deduce template argument for 'const std::vector<_Ty,_Alloc> &' from 'const int'
const int
なぜ aと aを比較しようとしているのpair<int,int>
ですか?
独自の比較関数を書いてみましたが、何も変わりません。私がそうすると、コンパイラは apair<int,int>
を aに変換しようとconst int
します。