| |
| |
| |
|
Page: 1 2 3 4 5 6 7 8
Comments:
<0> /who #c++ <1> sk8: you could do worse than look at the Dragon book <1> Amazon reviews from bitter undergraduates are hilarious <2> the problem with that peterhu <2> is that in future implementations <2> it MAY change the state <2> making an accessor necessary later <2> and, forcing you to redo all the code that didn't use the accessor to begin with. <3> huh? i just said that it doesn't make sense to have all "non-state changing" member functions as accessors <4> so only make the methods that purely access & return private attributes accessors? (using const declaration) <2> and, my argument is that it might make sense. <2> for the sake of future maintenance. <2> in case the way that cl*** functions changes. <2> and, a non-state changing member becomes a state changing member somehow. <2> Or, I guess my argument is more along the lines of, you should be careful with the decision. <2> since I tend to hate accessor functions
<5> hi <6> Properties > * <5> what's the FP equivalent of itoa()? <6> FP? <6> Functional programming? <5> floating point <2> stringstream <6> stringstream s; s << 123.56; string num = s.str(); <2> stringstream ss; <6> Whee! <2> float blah; <2> ss << blah; <2> yeah <2> what he did. <1> dont' forget to check state of the stream <2> screw that! <6> Or just use boost::lexical_cast <3> lexical_cast > Solamente <2> lexical_cast ****s <1> Solamente: what you mean when you said Properties? <3> noidea < Solamente <1> is that C# or something? <2> it just uses stringstream internally <5> i see <1> yea with allt he error checking done for you <5> thanks <2> pfft <6> Cowmoo: .NET, really. It's not specific to C#. <2> error checking is for losers <2> what could possibly go wrong with his example? <1> Solamente: oh ok <6> I started writing a property template one time. <6> I abandoned it for some reason... some kind of difficulty arose. <6> I need to dig that back out. <3> in c++/cli: ref cl*** Foo { property int Bar { int get() { return 3; } void set(int value) { /* whatever */ } } }; Foo^ f = gcnew Foo; f->Bar = 5; <6> So, why haven't you added an article on that to the C++/CLI wiki? <3> pfft <3> i still have that irc bot to finish <6> Lame excuse. <1> irc bot <1> wil it be for this channel? <3> yes, it can join and ridicule jblitzen right now <6> Dinnertime. Ravioli! <3> but not much else <1> I hope you're not writing it in C++ <3> c++/cli <1> ok no comment. <1> since I know nothing about that <1> however, you are gaey. <5> ok what do i do if i want to output a stringstream to the debug window? <3> i'm glad moo doesn't have ops <3> easier to mock him on wallops <7> what debug window? <3> ***uming windows, OutputDebugString <5> i tried that and the compiler doesn't like the cast <7> what cast?? <2> what's he helping with? <2> I don't see him talking. <3> wakjah, from what to what? <3> the function takes a LPCTSTR, which is either const char* or const wchar_t* depending on UNICODE preprocessor define
<3> (in reality, the documentation takes that, OutputDebugString itself is a define) <5> well it can't convert the parameter from a stringstream to an LPCTSTR so i tried a cast, which it didn't like either <3> so if you're building UNICODE, you'd use a wstringstream, get the string, and then do c_str() <3> if you're not building UNICODE, you'd use a stringstream as instructed above <2> unicode is for losers anyway. <1> we need Kniht and his calcs in here <1> that deserter. <2> his what? <2> where did Kniht go? <1> so somebody could've just calced convert2 <1> or convert <1> alternatively, SOMEONE is taking his sweet time with the bot <2> what? <2> calced convert2? <2> what are you converting? <1> not for me fool <1> for wakjah's original questino <1> oh nevermind <1> I'm off <2> what was his question? <7> wakjah and you don't cast <4> cheers guys i'm off to read over my multimedia module (image processing in java - meh) <7> you've been writing too much C <5> sorry i was afk for a while there <5> you don't cast? meaning just stringstream s; s << whatever; OutputDebugString(s); ? <8> s.str() to recover the std::string, then c_str if you need a const char * <8> or if this is still the "convert string of TYPE", boost::lexical_cast really is good <8> everyone using C++ should have boost on their include path <5> hum. is OutputDebugString(s.str().c_str()); right? if so then why is it saying there's a missing ; before OutputDebugStringA <8> probably because you missed a ; before OutputDebugString <5> i didn't, but then using a temp. const char * and setting that equal to s.str().c_str(), it doesn't complain <5> however it doesn't work either <6> Well, it's time to take the girls on their first golf game. <6> I just hope they don't beat me. <6> Elder daughter already drives around 175. <9> will a declaration such as this one create 3 lists on the stack? <9> list<ScatterVars*> l[3]; <7> bronaugh kinda <9> kinda? <7> well, what do you think a list is in this instance <7> and a list of raw pointers???? <9> it could be a list of integers. <7> that's not what you showed <9> would it -matter- wrt my question? <9> I don't have a bug. I'm asking now to make sure that the code snippet I pasted is going to behave as I understand it will, so that I won't have a bug later. <7> well, WHAT exactlly do you expect to have "on the stack" <10> A Queen of Spades and an Ace of Diamond <7> c++ doesn't require a stack, you know <9> well, I'd expect it to allocate 3 lists in that array and call the destructor for (and free the memory for) all three lists when they go out of scope. <9> allocate and construct. <7> well, it will do what you expect.... this isn't MS you know, not every thing is a special case <8> stand warned on storing raw pointers in container though <8> they become a pain to maintain <7> and a list of raw pointers is kinda expensive..... two pointers overhead just to hold one pointer <9> oh well. there's no more than 80 of them, tops. <9> so it's not a huge problem. <9> I suppose I should be dereferencing the pointers when I allocate them, then, and storing references to them? <9> then taking the address of the object at the reference and free()ing that when needed? <7> huh?????? <7> I have NO idea what you think you should be doing <9> well... the items are dynamically allocated. <9> items in the list. <8> you might want to google for smart pointers <9> nice... <8> judicious use of smart pointers (i.e. choosing the right variety) gives very GCish behaviour to C++, except with a lot more flexibility <9> so I see. <8> (and more chances to shoot yourself in the foot, but there we go. don't treat them as a panacea) <9> auto_ptr does look pretty nice for when you allocate memory within a function and just want it to clean up when it goes out of scope. <8> indeed <11> Smart pointers are the shiznit. <11> They eliminate tons of potentially duplicated and therefore tedious and error-prone cleanup code. <9> yeah...
Return to
#c++ or Go to some related
logs:
#linuxhelp #linuxhelp undernet mangalia #AllNiteCafe Another synaptic is running ati #php #php etho timed out debian Binary was not build with debugging information msdn wat does selam mean
|
|