Clan x86

Technical (Development, Security, etc.) => General Programming => Topic started by: Newby on June 03, 2009, 04:22:12 am

Title: Not sure of the wording for this project...
Post by: Newby on June 03, 2009, 04:22:12 am
But all I have to say is: the STL sucks fat penis.

2. Category class will contain an STL string for its name, an STL multiset of Item sorted by location, and an STL multimap of set Iterators with keys based on the corresponding Item’s price.

So Item looks like:

Code: [Select]
class Item {
  int price;
  string location;
  string description;
};

Not sure what to think of Category, though. I get the first two things.

Code: [Select]
class Category {
  string name;
  multiset<Item> items;
  // ???
};

But "an STL multimap of set Iterators with keys based on the corresponding Item’s price."

I have like, 0 idea how to envision that in my head.

Perhaps something like:

Code: [Select]
multimap<int, set<Item>::iterator> more_items;
I just have no idea what the hell is being asked for there. I can't imagine that data structure in my head. Fuck the STL. :(

Any thoughts?

EDIT -- Here's why I'm confused: as far as I know, an iterator just iterates over its container's type. If I have a set iterator, it needs an iterator to go over. Why would I have a multimap full of random iterators? Don't those iterators need a set to associate with? I'm confused. Bah!
Title: Re: Not sure of the wording for this project...
Post by: Newby on June 03, 2009, 06:58:26 pm
Never mind. Pwned that thing.