Salut DJM.
J'ai bien inséré #include <vector>.
Chez moi, à partir du moment où le compilateur Borland est activé, ça plante.
Que ce soit en vcl ou fmx. Mon code :
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26
| #include <fmx.h>
#pragma hdrstop
#include "Unit2.h"
#include <vector>
//---------------------------------------------------------------------------
#pragma package(smart_init)
#pragma resource "*.fmx"
TForm2 *Form2;
//---------------------------------------------------------------------------
__fastcall TForm2::TForm2(TComponent* Owner)
: TForm(Owner)
{
}
//---------------------------------------------------------------------------
void __fastcall TForm2::Button1Click(TObject *Sender)
{
std::vector<int> const tableau_entiers { 1, 2, 3 };
for (auto const element : tableau_entiers)
{
ListBox1->Items->Add(element);
}
} |
Compilation de Project2.cbproj (Debug, Win32)
[bcc32 Erreur] Unit2.cpp(20): E2108 Utilisation impropre de typedef 'std::vector<int,std::allocator<int> >'
Contexte d'analyseur complet
Unit2.cpp(19): analyse : void _fastcall TForm2::Button1Click(TObject *)
[bcc32 Erreur] Unit2.cpp(20): E2379 ; manquant dans l'instruction
Contexte d'analyseur complet
Unit2.cpp(19): analyse : void _fastcall TForm2::Button1Click(TObject *)
[bcc32 Erreur] Unit2.cpp(22): E2304 La variable Constante 'element' doit être initialisée
Contexte d'analyseur complet
Unit2.cpp(19): analyse : void _fastcall TForm2::Button1Click(TObject *)
[bcc32 Erreur] Unit2.cpp(22): E2141 Erreur de syntaxe de déclaration
Contexte d'analyseur complet
Unit2.cpp(19): analyse : void _fastcall TForm2::Button1Click(TObject *)
[bcc32 Erreur] Unit2.cpp(28): E2139 ; manquant dans la déclaration
Contexte d'analyseur complet
Unit2.cpp(19): analyse : void _fastcall TForm2::Button1Click(TObject *)
[bcc32 Erreur] Unit2.cpp(28): E2188 Syntaxe de l'expression
Contexte d'analyseur complet
Unit2.cpp(19): analyse : void _fastcall TForm2::Button1Click(TObject *)
[bcc32 Erreur] Unit2.cpp(28): E2378 ; manquant dans l'instruction For
Partager