| |
| |
| |
|
Page: 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27
<Trazer> I have a MyCl*** { std::auto_ptr<MyCl***Impl> _impl; }; to make the user of the cl*** independent of the real implementation.. But I get lots of warnings during compiling that when deleting cl*** I wont be deleting the implementation instance properly.. Do I have to keep this as a raw pointer and implement destructor for it to work correctly? <moralcode> have never heard of volcanos in alaska though <Soronel> moral: alaska <moralcode> might be because i live in sweden <Soronel> 's got an active volcano <Soronel> ah, heh <moralcode> :) <moralcode> i see <pepp^> Soronel: how do youknow more about alaska than your neighbors? <moralcode> grizzly bears and volcanos, good land to live in <Soronel> how about we dump all the nuclear waste in sweden? ought to drive your prices down some <Genia4_> because he cares? <moralcode> Soronel, why not..:) <Genia4_> why not drop the nuclear waste in antractica? <Soronel> pepp: I like the land more than I do my neighbors <binrapt> Moon <pepp^> sweden, all the hot chicks will die. you stupid. <Genia4_> nobody lives there... <anli> hm, dumping nuclear waste in sweden... hmm, maybe not :) <binrapt> Let's make the moon glow <Genia4_> yeah, the moon <Soronel> pepp: and actually, the story of one of the neighbors is kinda neat <Genia4_> Soronel: do tell <binrapt> Gosh, let's just shoot the waste into space <anli> what about not producing it in the 1st place :) <binrapt> Unpossible <Genia4_> binrapt: we'll get a ticket from some sort of space polic <Stinger> dont be silly <Genia4_> e <anli> hehe <pepp^> we could drop n waste on mars, kill or mutate any life there is <Stinger> no they would retaliate <Soronel> my dad had this friend since they were both young, 5 year old or so, the house we moved to is next door to that friend's wife's cousin, and we didn't know that at the time we bought the house <Genia4_> why not drop the waste into a vulcano <Stinger> hehe <Stinger> uuum <Stinger> heres the thing <moralcode> ...in alaska <binrapt> Great, radioactive lava \o/ <Stinger> volcanoes tend to, explode <Soronel> Genia: that seems like a really unpredictable disposal method <Stinger> sending dust and ash <binrapt> Spread the love \o/ <pepp^> Soronel: so what about that cousin? is she friendly to you? <Stinger> around the world <moralcode> binrapt, ssssch...hollywood might hear that <Soronel> I could go for deep ocean trenches though <Stinger> via the gulf stream <Soronel> pepp: yeah, we talk to her fairly often <Genia4_> well, we can drop it in one of earth's cracks <Genia4_> who would notice? <KimmoA> Is it good practice to first check if a bool variable is true before setting it to false? I'm talking about constantly setting it (or checking it and then setting it)? <binrapt> No, Hollywood is currently having an FPS boom <binrapt> Doom was first, Half-Life is next <moralcode> binrapt, i see <moralcode> half-life, for sure? <binrapt> Then Quake, etc <pepp^> its not a goood idea to drop n waste in earth's crack. in 50 years we would be living in those places <moralcode> how about commander keen <Stinger> they're making a halo movie apparently <Soronel> I liked commander keen <einride> do bee do we're now in the 30'th minute of a rebuild.... *sigh* <Genia4_> commander keen was fun <binrapt> Keen was depressive <Soronel> along with the duke nukem side scrollers <moralcode> www.commander.keen-movie.com <Genia4_> we need to build a huge space cannot <Genia4_> and shoot radiocative waste from it <Stinger> hehe <binrapt> http://www.imdb.com/title/tt0464037/ <Soronel> Genia: if a cannon was good enough for Hunter Thompson, a cannon's good enough for me! <Stinger> Genia4_ with the crazy dangerous nuclear waste disposal methods <binrapt> I demand the terra forming of the moon <binrapt> So we can use it as a recreational area for obese people <Soronel> wow, my typing on this keyboard is improving rapidly <binrapt> They weigh like 2/3 less up there <Genia4_> binrapt: yeah, let's pour tons of milk on it <Stinger> haha <moralcode> commander keen saving alaska from nuclear disposal <Genia4_> might turn into a huge cheese planet <moralcode> thatll be some movie <Genia4_> binrapt: 6 times less <binrapt> Oh <moralcode> Soronel, coffee does that :) <binrapt> Caffeine is national socialism <Yunited> i agree with binrapt. <Genia4_> caffeine is the best drug ever <moralcode> can i use std::string to deal with UTF-8? <KimmoA> Is it good practice to first check if a bool variable is true before setting it to false? I'm talking about constantly setting it (or checking it and then setting it)? <jberg> morcalcode std::wstring <binrapt> moralcode: You can store it in there but it is not made for that purpose <moralcode> i see <Trazer> KimmoA: Unless you need to know the previous state, no <Soronel> Genia: I dunno, I like opiates <moralcode> std::wstring, is it possible to use like normal strings? <moralcode> all the operations and such <Soronel> there's a lot to be said for not being in pain <Soronel> moral: yes <KimmoA> Trazer: I don't follow your multi-level arguing. Does that mean that it's good practice or that it's not? :) <moralcode> Soronel, sweet <Soronel> moral: wstring is std::basic_string specialized for wchar_t <KimmoA> (Of course the state is unknown.) <Alipha> moralcode: and then you'd use std::wcout, std::wcin, etc <moralcode> nice, are there any conversions between wstring and string or do i have to make the whole application wstring? <moralcode> Alipha, good info <Alipha> moralcode: depends upon how you want to convert <jberg> kimmoa, if you want the previous value, sure check it. if you don't need it, why the hell would you? <KimmoA> I don't know. <KimmoA> Maybe checking it is less "costy". <Soronel> moralcode: I'm pretty sure you can convert somehow with std::ctype<>::widen() <jberg> checking is never less costy than not checking <Soronel> not sure exactly how though <KimmoA> jberg: No, but if it's true, I won't be setting it. <KimmoA> jberg: So then I'll save that instruction... <binrapt> KimmoA: Just set it <moralcode> Soronel, ok thank you...have to figure a bit <Alipha> Soronel: my guess is that that would truncate off any values greater than CHAR_MAX. but that's just a guess <KimmoA> Bah. <binrapt> A check is slower obviously <KimmoA> How is that obvious? <binrapt> Do you know ***embly? <Soronel> Alipha: well, std::string can be MBCS depending on the locale, right? <KimmoA> Nope. <jberg> because doing something compared to not doing something is obviously slower <Alipha> Soronel: I'm actually probably overstepping my knowledge ;-) <binrapt> Well, you would need an additional comparison and a conditional jump <Soronel> jberg: depends on how you define 'cost' <KimmoA> Setting something feels like doing something to me. <binrapt> Checking is doing something, too <Soronel> jberg: if not checking causes your $250 sattelite to be lost, that's pretty costly <Trazer> KimmoA: Might not be obvious.. But no matter if it was quicker, don't clutter up your code with stupid optimizations unless you've got a performance problem in that part of the code, and that is the bottleneck.. <binrapt> I don't think a boolean is worth a comparison :P <KimmoA> Hmm... I guess you're right. <binrapt> Everything larger, sure <jberg> soronel, yeah.. but in this case i think costly is defined by number of operations :) <KimmoA> I haven't yet understood that CPUs are so damn fast. <Wizaka> KimmoA, setting a bool is seting 8 bits... it's fast. <binrapt> Not necessarily <Soronel> Wizaka: bool is often made larger to be better suited for alignment <binrapt> Indeed <Wizaka> so it's even faster. <Stinger> it might be smaller than 8 bits <mauke> I doubt that <Soronel> although one interesting thing I noticed, I had a couple bools in a struct, and gcc with space optimization packed them to one byte each <Stinger> if your architecture has bit manipulation instructions <Stinger> the access I mean <Soronel> Stinger: bools have to be addressable <Soronel> bits aren't <Stinger> yeah I'm talking about the access specifically <Trazer> Well.. The bool may already be in a register, so checking it might only be a register operation.. Writing it however, might require that you write it back to your cache.. So can be slower.. But to pay a branching for it just sounds ridiculous...
Return to c++ or Go to some related
logs:
chatzone rt2500 latest patch
|
|