STL Poll
-
[rant] map::iterator it = mymap.find(x); How many help pages must I visit to find out if it->second returns a reference to T2 or a copy. 1. 1 2. 2 3. 5 4. 10 5 100 6. all of the above 7. all available 8. none of the above, write your own map or live with thousands of copies [/rant]
-
[rant] map::iterator it = mymap.find(x); How many help pages must I visit to find out if it->second returns a reference to T2 or a copy. 1. 1 2. 2 3. 5 4. 10 5 100 6. all of the above 7. all available 8. none of the above, write your own map or live with thousands of copies [/rant]
7. all available Crivo Automated Credit Assessment
-
[rant] map::iterator it = mymap.find(x); How many help pages must I visit to find out if it->second returns a reference to T2 or a copy. 1. 1 2. 2 3. 5 4. 10 5 100 6. all of the above 7. all available 8. none of the above, write your own map or live with thousands of copies [/rant]
??? What's this all about? We, WinCE programmers, don't use too much STL ;-) ;-) Nish Sonork ID 100.9786 voidmain www.busterboy.org If you don't find me on CP, I'll be at Bob's HungOut
-
[rant] map::iterator it = mymap.find(x); How many help pages must I visit to find out if it->second returns a reference to T2 or a copy. 1. 1 2. 2 3. 5 4. 10 5 100 6. all of the above 7. all available 8. none of the above, write your own map or live with thousands of copies [/rant]
That's the main reason I'm still not using STL..even for the collection classes (the other being the fact that I compile at warning level 4, with the warnings as errors switch enabled). I haven't seen the STL help/implementation in VC7 yet, but hopefully things will have improved at least a little. :rolleyes: Andy Metcalfe - Sonardyne International Ltd
Trouble with resource IDs? Try the Resource ID Organiser Add-In for Visual C++ 5.0/6.0
"I'm just another 'S' bend in the internet. A ton of stuff goes through my system, and some of the hairer, stickier and lumpier stuff sticks." - Chris Maunder (I just couldn't let that one past ;)) -
??? What's this all about? We, WinCE programmers, don't use too much STL ;-) ;-) Nish Sonork ID 100.9786 voidmain www.busterboy.org If you don't find me on CP, I'll be at Bob's HungOut
Nish [BusterBoy] wrote: We, WinCE programmers, don't use too much STL Exactly that's the point - STL is part of the C++ Standard Library, and should be the array class, the list class, the Map class we use - still many of us avoid it for this or that reason.
-
[rant] map::iterator it = mymap.find(x); How many help pages must I visit to find out if it->second returns a reference to T2 or a copy. 1. 1 2. 2 3. 5 4. 10 5 100 6. all of the above 7. all available 8. none of the above, write your own map or live with thousands of copies [/rant]
-
[rant] map::iterator it = mymap.find(x); How many help pages must I visit to find out if it->second returns a reference to T2 or a copy. 1. 1 2. 2 3. 5 4. 10 5 100 6. all of the above 7. all available 8. none of the above, write your own map or live with thousands of copies [/rant]
peterchen wrote: How many help pages must I visit to find out if it->second returns a reference to T2 or a copy. The same applies to the MSDN library. Having never come across the STL until last week, the
second
method confused me a bit. Think the MSDN library came up with anything? :rolleyes: Simon Hey, it looks like you're writing a letter! Sonork ID 100.10024 -
[rant] map::iterator it = mymap.find(x); How many help pages must I visit to find out if it->second returns a reference to T2 or a copy. 1. 1 2. 2 3. 5 4. 10 5 100 6. all of the above 7. all available 8. none of the above, write your own map or live with thousands of copies [/rant]
You can't blame the STL for M$ putting little to no clear docs in the MSDN. They want you to use THEIR poxy containers, and tie you to THEIR platform. I have three STL books, all Addison Wesley as it happens, and I have never had any difficulty between them and Stroustrup getting any answers I need, and the more I use STL, the worse CArray/CMap/etc. looks. Christian After all, there's nothing wrong with an elite as long as I'm allowed to be part of it!! - Mike Burston Oct 23, 2001
Sonork ID 100.10002:MeanManOz
I live in Bob's HungOut now
-
??? What's this all about? We, WinCE programmers, don't use too much STL ;-) ;-) Nish Sonork ID 100.9786 voidmain www.busterboy.org If you don't find me on CP, I'll be at Bob's HungOut
-
[rant] map::iterator it = mymap.find(x); How many help pages must I visit to find out if it->second returns a reference to T2 or a copy. 1. 1 2. 2 3. 5 4. 10 5 100 6. all of the above 7. all available 8. none of the above, write your own map or live with thousands of copies [/rant]
Waah, my first post to The Lounge and it's about programming :) . I thought I'd make myself useful first. Besides, I can't just look while you're putting down my favorite library. Anyway, it->second doesn't return anything. It can't because it is not a method/function, it's a member object of the class map<T1, T2>::value_type, that is, a member of pair<T1, T2>. So if you want a reference use it->second to initialize a reference of the corresponding type. No need for copies there. HTH.
-
You can't blame the STL for M$ putting little to no clear docs in the MSDN. They want you to use THEIR poxy containers, and tie you to THEIR platform. I have three STL books, all Addison Wesley as it happens, and I have never had any difficulty between them and Stroustrup getting any answers I need, and the more I use STL, the worse CArray/CMap/etc. looks. Christian After all, there's nothing wrong with an elite as long as I'm allowed to be part of it!! - Mike Burston Oct 23, 2001
Sonork ID 100.10002:MeanManOz
I live in Bob's HungOut now
STL sucks anyway ;) The MSDN documentation is not bad as reference - admittedly useless for learning. Where I blame STL is the complex non-intuitive design, trying to solve all problems of the world in one template. I'm coding C++ for over a decade, and I'm not bad at this, still, anytime I say "hey, why not using STL" I bump into something stupid. I'm at easy with heavy templating, I got used to the awkward syntax, I got used to the huge error messages (yes I know the prettyfier), I got used to the though that I'd probably have to digest an entire STL book, but how the hell shall a newbie get along with this library, and accept it as "standard"? I finally fired up the debugger, checked what the stuff does, and prayed that it's either standard or I never have to port (the latter being highly unlikely). Peter P.S. who is M$ ?
-
[rant] map::iterator it = mymap.find(x); How many help pages must I visit to find out if it->second returns a reference to T2 or a copy. 1. 1 2. 2 3. 5 4. 10 5 100 6. all of the above 7. all available 8. none of the above, write your own map or live with thousands of copies [/rant]
Pointers are your friend.
Todd Smith
-
STL sucks anyway ;) The MSDN documentation is not bad as reference - admittedly useless for learning. Where I blame STL is the complex non-intuitive design, trying to solve all problems of the world in one template. I'm coding C++ for over a decade, and I'm not bad at this, still, anytime I say "hey, why not using STL" I bump into something stupid. I'm at easy with heavy templating, I got used to the awkward syntax, I got used to the huge error messages (yes I know the prettyfier), I got used to the though that I'd probably have to digest an entire STL book, but how the hell shall a newbie get along with this library, and accept it as "standard"? I finally fired up the debugger, checked what the stuff does, and prayed that it's either standard or I never have to port (the latter being highly unlikely). Peter P.S. who is M$ ?
That's exactly why I don't use STL; the syntax sucks! If I'm writing a C++ app without MFC and need an array, list, or stack class, I've got my own implementations that I use. No iterators for me, thank you. Jamie Nordmeyer Portland, Oregon, USA
-
STL sucks anyway ;) The MSDN documentation is not bad as reference - admittedly useless for learning. Where I blame STL is the complex non-intuitive design, trying to solve all problems of the world in one template. I'm coding C++ for over a decade, and I'm not bad at this, still, anytime I say "hey, why not using STL" I bump into something stupid. I'm at easy with heavy templating, I got used to the awkward syntax, I got used to the huge error messages (yes I know the prettyfier), I got used to the though that I'd probably have to digest an entire STL book, but how the hell shall a newbie get along with this library, and accept it as "standard"? I finally fired up the debugger, checked what the stuff does, and prayed that it's either standard or I never have to port (the latter being highly unlikely). Peter P.S. who is M$ ?
peterchen wrote: STL sucks anyway Those are SERIOUS fighting words. The STL rules in so many ways, it's beyond my comprehension that something could be so *cool*. peterchen wrote: but how the hell shall a newbie get along with this library, and accept it as "standard"? By not biting off more than they can chew. Vector is very intuitive, you push onto it, you pop off it. Iterators are the most logical thing in the world - they define a range, and for vector are probably pointers anyhow. You use pointers, don't you ? peterchen wrote: I finally fired up the debugger, checked what the stuff does, and prayed that it's either standard or I never have to port Use STL Port, it's a better STL implimentation, has hash tables and is cross platform. peterchen wrote: P.S. who is M$ ? Company run by Bill Gate$. Christian After all, there's nothing wrong with an elite as long as I'm allowed to be part of it!! - Mike Burston Oct 23, 2001
Sonork ID 100.10002:MeanManOz
I live in Bob's HungOut now
-
That's exactly why I don't use STL; the syntax sucks! If I'm writing a C++ app without MFC and need an array, list, or stack class, I've got my own implementations that I use. No iterators for me, thank you. Jamie Nordmeyer Portland, Oregon, USA
Why don't you write your own bitmap class then ? It's a lot easier than writing a map, for example. How about your own operating system. Why use MFC, why not write your own class library ? It's the SAME THING. Why waste time refining your own containers when a ready made set is wating for you. If you're using MFC and use CArray, how do you go about sorting it ? How about if you have an array of numbers and want their sum ? I don't get why people would waste time writing such trivial stuff when it's sitting there. Jamie Nordmeyer wrote: That's exactly why I don't use STL; the syntax sucks! That is just pathetic. Yes, it might take you a day to learn how to syntax works, but why would you put the time into learning C++ syntax and not STL ? It's really quite intuitive once you've taken the time to learn how it works. Jamie Nordmeyer wrote: No iterators for me, thank you. So you don't use pointer arithmetic then ? That's what pretty much every vector iterator known to man uses. I just don't get it. Christian After all, there's nothing wrong with an elite as long as I'm allowed to be part of it!! - Mike Burston Oct 23, 2001
Sonork ID 100.10002:MeanManOz
I live in Bob's HungOut now
-
Waah, my first post to The Lounge and it's about programming :) . I thought I'd make myself useful first. Besides, I can't just look while you're putting down my favorite library. Anyway, it->second doesn't return anything. It can't because it is not a method/function, it's a member object of the class map<T1, T2>::value_type, that is, a member of pair<T1, T2>. So if you want a reference use it->second to initialize a reference of the corresponding type. No need for copies there. HTH.
Peter Godec wrote: Waah, my first post to The Lounge and it's about programming Welcome - nice to meet you. :-) Peter Godec wrote: Besides, I can't just look while you're putting down my favorite library. Well, double welcome. Can't have too many STL fans here, IMO. Have you read Scott Meyers 'Effective STL' yet ? I reckon it's the best book I bought this year. Christian After all, there's nothing wrong with an elite as long as I'm allowed to be part of it!! - Mike Burston Oct 23, 2001
Sonork ID 100.10002:MeanManOz
I live in Bob's HungOut now
-
Waah, my first post to The Lounge and it's about programming :) . I thought I'd make myself useful first. Besides, I can't just look while you're putting down my favorite library. Anyway, it->second doesn't return anything. It can't because it is not a method/function, it's a member object of the class map<T1, T2>::value_type, that is, a member of pair<T1, T2>. So if you want a reference use it->second to initialize a reference of the corresponding type. No need for copies there. HTH.
-
peterchen wrote: STL sucks anyway Those are SERIOUS fighting words. The STL rules in so many ways, it's beyond my comprehension that something could be so *cool*. peterchen wrote: but how the hell shall a newbie get along with this library, and accept it as "standard"? By not biting off more than they can chew. Vector is very intuitive, you push onto it, you pop off it. Iterators are the most logical thing in the world - they define a range, and for vector are probably pointers anyhow. You use pointers, don't you ? peterchen wrote: I finally fired up the debugger, checked what the stuff does, and prayed that it's either standard or I never have to port Use STL Port, it's a better STL implimentation, has hash tables and is cross platform. peterchen wrote: P.S. who is M$ ? Company run by Bill Gate$. Christian After all, there's nothing wrong with an elite as long as I'm allowed to be part of it!! - Mike Burston Oct 23, 2001
Sonork ID 100.10002:MeanManOz
I live in Bob's HungOut now
****Christian Graus wrote: Those are SERIOUS fighting words Your quote missed the smiley! Seriously, I do appreciate the power and cleverness of STL, and it's elegance (in a baroque sense). However, it has some things that make it (in my eyes) unfit for a standard library. And anytime I try to use it I'm stuck with something I consider "should be intuitive", but which takes me quite some time to figure out. Peter
-
Why don't you write your own bitmap class then ? It's a lot easier than writing a map, for example. How about your own operating system. Why use MFC, why not write your own class library ? It's the SAME THING. Why waste time refining your own containers when a ready made set is wating for you. If you're using MFC and use CArray, how do you go about sorting it ? How about if you have an array of numbers and want their sum ? I don't get why people would waste time writing such trivial stuff when it's sitting there. Jamie Nordmeyer wrote: That's exactly why I don't use STL; the syntax sucks! That is just pathetic. Yes, it might take you a day to learn how to syntax works, but why would you put the time into learning C++ syntax and not STL ? It's really quite intuitive once you've taken the time to learn how it works. Jamie Nordmeyer wrote: No iterators for me, thank you. So you don't use pointer arithmetic then ? That's what pretty much every vector iterator known to man uses. I just don't get it. Christian After all, there's nothing wrong with an elite as long as I'm allowed to be part of it!! - Mike Burston Oct 23, 2001
Sonork ID 100.10002:MeanManOz
I live in Bob's HungOut now
Whoa there! TRUCE!!! TRUCE!!! :) :) Hey, we're all programmers here, right? I have my opinion, and you have yours. I have my style of doing things, you have yours. Many people would say that anyone who uses MFC is a moron, others say that anyone who DOESN'T use MFC is a moron. It's all about your own particular style, in my very humble opinion. You like STL (actually, considering the way that you're defending it, I have to ask if you wrote it ;) ). OK, then use it. I don't particularly like it, so I don't use it. I want a Dodge Prowler, you may think they're garbage. It's in the opinion. I never claimed that STL sucks, just the syntax. From what I've used of it, and from what I've read about it, it's a very efficient library. But, like MFC (hell, Windows, for that matter), it's not for everybody. Frankly, I've been doing a lot of C style SDK programming as of late, just to learn how Windows operates behind the mask that is MFC, so neither CArray or std::vector will work for me. :rolleyes: Just good 'ol malloc and free. Keep coding Christian, and don't take it so personally.:cool: Jamie Nordmeyer Portland, Oregon, USA
-
Peter Godec wrote: Waah, my first post to The Lounge and it's about programming Welcome - nice to meet you. :-) Peter Godec wrote: Besides, I can't just look while you're putting down my favorite library. Well, double welcome. Can't have too many STL fans here, IMO. Have you read Scott Meyers 'Effective STL' yet ? I reckon it's the best book I bought this year. Christian After all, there's nothing wrong with an elite as long as I'm allowed to be part of it!! - Mike Burston Oct 23, 2001
Sonork ID 100.10002:MeanManOz
I live in Bob's HungOut now
Have you read Scott Meyers 'Effective STL' yet ? I reckon it's the best book I bought this year. I've heard only good things about Meyers' Effective... books, but Stroustrup's bible and occasional visits to the comp.lang.c++ are sufficient for me right now (there are some really smart people on that newsgroup). While we're at it, another free source of great C++ info is the C++ Experts Forum on the CUJ website (quite advanced stuff though:omg: ). --peter