私は Borland C++ builder 5.0 を初めて使用します。あるマシン (Windows 2003 Server SP2) では正常にコンパイルされる小さな STL アプリケーションを使用しましたが、別のマシン (Windows XP マシン SP3) では正常にコンパイルされませんでした。コード スニペットとエラー メッセージを配置しました
Error E2285 Could not find a match for 'distance<>(const AnsiString *,const AnsiString *,i
nt)
Borland C++ Form を開き、Form Create に以下のコードを追加しました。
#include <vcl.h>
#pragma hdrstop
#include <vector>
using namespace std;
using std::distance;
static const AnsiString Text_FieldsInTypen[]=
{
"code_segment_national_2"
};
#include "Unit1.h"
//---------------------------------------------------------------------------
#pragma package(smart_init)
#pragma resource "*.dfm"
TForm1 *Form1;
//---------------------------------------------------------------------------
__fastcall TForm1::TForm1(TComponent* Owner)
: TForm(Owner)
{
}
//---------------------------------------------------------------------------
void __fastcall TForm1::FormCreate(TObject *Sender)
{
vector<AnsiString> aVec;
aVec.push_back("Test");
const AnsiString* Iter;
int Index = 0;
distance(Text_FieldsInTypen, Iter, Index);
}
//---------------------------------------------------------------------------