lot of thanking you sir dowt in pointer sir some information send to mail
hamis
n/a <[EMAIL PROTECTED]> wrote:
Unbelievable!! you cannot imagine how much time I spent on this!
Thanks a million!!!
--- In [email protected], David Fleury
<[EMAIL PROTECTED]> wrote:
>
>
> > -----Message d'origine-----
> > De la part de n/a
> > Envoyé : vendredi 12 janvier 2007 13:23
> > À : [email protected]
> > Objet : [c-prog] C++ templates
> >
> > Hi,
> >
> > I am trying to write a generic template class that uses a
> > generic map data member over the parametrized types, so it
> > looks like this:
> >
> > template <class A, class C> class MyClass{
> >
> > public:
> > typedef map<A,A,C> myMapType;
> > //keys and values of type A, comparator of type C.
> >
> > void myMethod() { };
> >
> > private:
> > myMapType _myMapInstance;
> > }
> >
> > Now I would like myMethod() to iterate over the data
> > _myMapInstace, so I need an iterator of type myMapType::iterator.
> >
> > Suppose I declare :
> > typename myMapType::iterator myIterator; within the class definition,
>
>
> Probably typedef is missing before typename
> typedef typename myMapType::iterator myIterator;
>
> >
> > and declare myMethod as:
> > void myMethod() {
> > myIterator iter = _myMapInstance.begin();
> > compiler errors: -warning: statement has no effect
> >
> > -error: expected `;'
before "iter"
> >
> > // some more code...
> >
> > }
>
> ;
>
> >
> > the compiler won't compile my code and I get the blue error
> > messages. Putting the typename definition just before the
> > creation of the iterator yields the same result.
> >
> > What am I doing wrong? How can I define an iterator over
> > _myMapInstance, when the exact type of myMapType is dependent
> > on the parametrized values A, C.
> >
> > Thanks a lot!
> >
> > Eden.
>
> Ce message et ses pièces jointes (le "message") est destiné à
l'usage
> exclusif de son destinataire.
> Si vous recevez ce message par erreur, merci d'en aviser
immédiatement
> l'expéditeur et de le détruire ensuite. Le présent message pouvant
> être altéré à notre insu, CALYON Corporate and Investment Bank
> ne peut pas être engagé par son contenu. Tous droits réservés.
>
> This message and/or any attachments (the "message") is intended for
> the sole use of its addressee.
> If you are not the addressee, please immediately notify the sender
and
> then destroy the message. As this message and/or any attachments may
> have been altered without our knowledge, its content is not legally
> binding on CALYON Corporate and Investment Bank. All rights reserved.
>
---------------------------------
Heres a new way to find what you're looking for - Yahoo! Answers