Double_t array in parameter


I have a problem with my class:

class myClass : public TNamed { private: TList lst_; public: myClass(Double_t * arr); };

I would like to have the possibility to add a list of Double_t values in the TList and sort them;
As it’s impossible to add Double_t values in TList, I have made an other class with a Double_t attribute and compare method.

but my problem is in constructor of myClass. How can i give a list of double values without giving the number of elements?

First idea:

    Double_t lst[] = {8.1, 1.0 , 3.2};
    myClass * m = new myClass(lst);

But with this, i can’t have the number of elements (sizeof(lst) returns 4), and i have to use two lines of code, and i prefer one line.
myClass * m = new myClass({8.1, 1.0 , 3.2}} is not possible

Second idea:
I have tried the vector class, but you have to give the number of elements too.

Third idea:

    myClass * m = new myClass("7.1 1.0 3.2");

I use then the Tokenize method of TString, but it returns an TObjArray of TObjString, and then i can’t convert the TObjStrings in Double_t.

Any Idea?

ok I have found what i was looking for.

Bool_t convertToDouble(const TString& token, Double_t& value)
char* endptr = 0;
const char* data = token.Data() ;

value = strtod(data, &endptr) ;
Bool_t error = (endptr-data!=token.Length()) ;

if (error) {
cout << “parse error, cannot convert '”
<< token << “’” << " to double precision" << endl ;
return error ;