Replace list with vector and I think it should work. I don't think the operator[] is overloaded for list, because of the fact that it's not random access. Everything else should work, though.
Tanner On Thu, 2002-02-14 at 05:34, M. Mueller (bhu5nji) wrote: > I think I have some solid evidence to rank two STL books and it hinges on > example variety. > > The Josuttis book examples (downloaded from the web) often show that sequence > container (vector, deque, list) elements can be directly accessed in a manner > similar to arrays: > > list<string> a; > > if (a[3] == "blah") doSomething(); > > I have a very simple language to parse. I am told 4 position sensitive > things in a string. I parse the string into a list, a, of strings. If > a.size() != 4 then I ignore the statement. Otherwise, I start analysing > a[0]..a[3]. > > A quick scan of Josuttis examples suggests this approach will work. The > Musser et al book was not so helpful. The Musser et al book does use this > technique and the book's formal definition of the technique is still hiding > from me. > > These books are nearly $50 each. > > > _______________________________________________ > Dev mailing list > [EMAIL PROTECTED] > http://www.trilug.org/mailman/listinfo/dev -- Tanner Lovelace | [EMAIL PROTECTED] | http://wtl.wayfarer.org/ --*--*--*--*--*--*--*--*--*--*--*--*--*--*--*--*--*--*--*--*--*--*-- GPG Fingerprint = A66C 8660 924F 5F8C 71DA BDD0 CE09 4F8E DE76 39D4 GPG Key can be found at http://wtl.wayfarer.org/lovelace.gpg.asc --*--*--*--*--*--*--*--*--*--*--*--*--*--*--*--*--*--*--*--*--*--*-- Those who are willing to sacrifice essential liberties for a little order, will lose both and deserve neither. -- Benjamin Franklin History teaches that grave threats to liberty often come in times of urgency, when constitutional rights seem too extravagant to endure. -- Justice Thurgood Marshall, 1989
signature.asc
Description: This is a digitally signed message part
