4 ms·
So auto allows you to deal more easily with c++ crap, especially STL. My first thing to do in all my c++ project is to import my in-house STL wrapper, which mak
by fenesiistvan 11y ago
So auto allows you to deal more easily with c++ crap, especially STL.
My first thing to do in all my c++ project is to import my in-house STL wrapper, which makes STL usable for me.
I never understood how people can work with raw STL. I don't like at all working with templates and i am using it only in internal class implementations.
C++ without templates is so much more beautiful.
- therein 11y agoWould you mind giving some examples? I don't find STL to be crap at all.
- superrad 11y agostd::unordered_map<std::string, SomeClassName>::iterator it = hashmap.begin(); vs auto it = hashmap.begin(); I find auto useful for cutting down some of the verbosity of templates STL containers, but I can see how over use can lead to code requiring much more referencing if maintaining code that rarely defines types.
- therein 11y agoOh no, I agree with that. I was specifically talking about fenesiistvan's point about his STL wrapper. I was wondering what his use cases were. No doubt auto is extremely useful in a case like the one you mentioned. In fact, even more so in here: for (std::unordered_map<std::string, std::unordered_map<std::string, long>*>::const_iterator it = a.begin(); ...)
- fenesiistvan 11y agoI am used with the old Delphi / C++ Builder style. I think that it is much more clear than than bot the STL and the new trendy C11 style. So my hashmap handling looks like this: MHashMap userlist = new MHashMap<HUser>(); HUser *user = userlist->First(); while(user) { user->DoSomething(); user = userlist->Next(); }