Welcome! Log In Create A New Profile

Advanced

help with SequenceTmpl :: operator[]

Posted by chaospixel 
Announcements Last Post
Announcement SoC Curricula 09/30/2017 01:08PM
Announcement Demarcation or scoping of examinations and assessment 02/13/2017 07:59AM
Announcement School of Computing Short Learning Programmes 11/24/2014 08:37AM
Announcement Unisa contact information 07/28/2011 01:28PM
help with SequenceTmpl :: operator[]
April 18, 2006 11:34PM
I would like some guidance on how to use operator[] with sequences...

From the various documentation it seems that the intent is for this operator to be used to both access and manipulate elements in a sequence. I have been unable to figure out what type this operator is expecting or how to declare an object of that type.

sequence.h declares the following:

template<class T, int TID>
inline T &
SequenceTmpl<T,TID> :: operator[] (MICO_ULong idx)
{
return vec[idx];
}

mico generates the following idl from currency.idl:

typedef SequenceTmpl< Country,MICO_TID_DEF> Countries;

so why does the following not compile?

Country yada;
Countries countries();
countries.length(1);
countries[0] = yada; // fails

operator[] seems to both return and accept SequenceTmpl<Currency :: Country, 0> rather than T, which is what the header seems to be saying.

please help.
Sorry, only registered users may post in this forum.

Click here to login