Hi Vassili,
CINT has known problems interpreting STL. There are two things I can suggest you to do:
Cheers, Axel.
On 2008-07-31 11:48, Vassili Maroussov wrote:
> Dear ROOTers,
>
> I'm wondering why the STL "set" works differently in a ROOT session and
> compiled code. More specifically, why in the ROOT session it requires an
> explicit declaration of "Compare" while the comparison for object is
> defined. For instance consider the following sample code:
>
> *///file: test_set.C/
> #include <iostream>
> #include <set>
>
> void test_set()
> {
> int i1 = new int();
> int i2 = new int();
>
> ///Checking whether the integer pointer comparison is defined/
> std::cout << "(i1 < i2) = " << (i1 < i2) << "\t"
> << "(i1 > i2) = " << (i1 > i2) << std::endl;
>
> ///Declaring a set of integer pointers/
> set<int*> ip_set;
> } ///end file test_set.C/
> *
> The ROOT session transcript:
>
> *root [0] .x test_set.C
> (i1 < i2) = 1 (i1 > i2) = 0
> Error: Too few template arguments test_set.C:14:
> Error: template argument for Compare missing test_set.C:43:
> Error: template argument for Compare missing test_set.C:44:
> Error: template argument for Compare missing test_set.C:62:
> Error: template argument for Compare missing test_set.C:62:
> Error: template argument for Compare missing test_set.C:64:
> Error: template argument for Compare missing test_set.C:64:
> *
> I'm also wondering how line numbers 43-64 can appear in the error
> massages, the sample code is just 15 lines long?
>
> Regards,
>
> Vassili
>
Received on Thu Jul 31 2008 - 11:53:59 CEST
This archive was generated by hypermail 2.2.0 : Fri Aug 01 2008 - 17:50:01 CEST