http://en.cppreference.com/w/cpp/container/set Although personally http://en.cppreference.com/w/cpp/container/vector http://en.cppreference.com/w/cpp/algorithm/sort http://en.cppreference.com/w/cpp/algorithm/lower_bound http://en.cppreference.com/w/cpp/container/vector/insert
Set is unordered. Vector doesn't handle arbitrary inserts well, only push_back. Deques only do push_front and push_back well. So we're left with lists being the only performant option. Essentially, we made it out of a std::map of linked list iterators (for random access), and a linked list (for ordering).
No, it isn't. Insertion is linear, but vectors are sequential. If you're working with data of any reasonable size, cache misses during iteration will screw you over long before the linear insertion does. ( Edit: ) And if you're doing mass insertions, you can probably just insert at the end, sort the inserted range, and then do an inplace_merge.
Oh! I'm so sorry. My bad. I had this backwards. Terminology error. We needed an ordered set, meaning we specify the order. 14 hour day. Unordered_set doesn't do this either.
You mean you have data that has to be sorted in an unintuitive fashion? I'm fairly sure sets and maps allow you to specify the comparison function on creation. Edit: I'm not hounding you, now I'm actually curious as to what you were trying to do.
No, I mean data whose order has meaning, but having two copies of the same data in the set is disallowed. For instance, consider a list of gui windows. You don't want to duplicate the windows. You do want random access, and you also want to be able insert or move a window to the top quickly. (And order matters, because drawing order.) I suppose a better name for this would be OrderableSet
Awesome! Loved this post. Got immersed in it haha, before I knew it I finished it all and noticed eyes peering at me. Yeah out with my wife on our anniversary, but could not help myself and had to read this. Sounds so fun working with a team :/ awesome guys keep up the good work.
Ahhhh, okay, I'm starting to get a picture. You want a randomly accessible sequential container with no duplicate entries. It.. still sounds like something you'd want to build on top of a vector, honestly. It's the "no duplicate entries" bit that's weird. Item lists comes to mind. Being able to refer to objects by name also sounds useful, but maybe you'd want some weird combination of an unordered set and a vector.. Ehh, whatever, I can't really give any relevant input without knowing the problem domain better. Either way, hope it all works out cleanly. Good luck.
Depending on usage a deque or vector based solution might wind up being faster, especially if it's iterate often modify seldom. We won't bother trying to optimize it much more right now, because I don't really have much indication that it's going to be hot code. But I will keep your suggestion in mind in the future if needed. Thanks for the interest, and I'm sorry about earlier. I was a little bit burned out, and I got c++ terminology conventions confused.
I noticed you guys talking about the camera with the fixed position camera. Might I ask what the limits are to modifying the camera? Like, for example, changing the angle. I want to know if it's possible to mod in something where the camera is flipped 180 degrees or even 90 degrees.
I myself am hoping to go into programming, and i dont know much about it yet, but im saving for school for it. Reading this post makes me want to try even harder! You guys are great!
Are You Guys going to improve the FPS/Engine of Starbound? Because My Mac has some Lag spikes while Playing.
In case you didn't hear, it has been stated officially that optimization will come during phase two of the beta (which I recall to be feature complete). We are here discussing stage one, which is mainly development of features (or something, the important bit is that it isn't about optimizing).