@# Quotes DB     useful, funny, interesting





Google
 
Web www.quotesdb.info
Undernet  |  EFnet  |  Quakenet  |  Freenode  |  Dalnet  |  Ircnet  |  Galaxynet
Page: 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19



Comments:

<0> You could inherit and have them virtual
<0> Or use signals
<1> Ibiwan make a cl*** and use virtual functions
<2> yay for polymorphism :0
<1> successor?
<3> yah -- if you're looking at a given node, what's a list of the possible "next" nodes
<3> implementing A* search
<2> Node.next() ?
<2> oh
<3> unfortunately there's not just one "next" for any given node
<2> Are you using linkedlists or what?
<3> hence the return type being an STL object -- I have it as a vector<T> right now, where T is the node type
<1> std::vector<boost::shared_ptr<Node> > Node::next() const
<1> do you want COPIES of them?
<3> you think I should p*** a pointer to an empty vector, have it just fill it in?



<1> I was referring to vector<T> instead of vector<boost::shared_ptr<T> >
<0> You'd p*** an array anyway, not a pointer
<0> ehm
<0> You'd p*** a reference anyway, not a pointer
<1> whew, I thought Ashe` had gotten drunk while online
<3> well I don't know boost
<4> to not know boost is to not know where C++ is headed
<1> if you're doing serious C++ you should.. shared_ptr<> has been adopted into TR1
<1> so it will be in the standard library "soon"
<3> okay
<4> wasn't boost::function as well?
<0> Soon as in 20xx
<1> supposely 200x
<4> yep, tr1::function
<1> and bind
<1> I think bind1st and bind2nd are going to be deprecated also
<4> good stuff, indeed
<1> but Ibiwan at least vector<T*>
<4> bjarne is a bit disappointed judging by his article summarizing some 0x changes
<1> otherwise you will have copies of the "next" things
<1> maybe I need to write my article bashing all the stupid things that aren't yet fixed in the core language
<3> doesn't the function generating them go out of scope immediately afterwards anyway, so there's only one set of "next"?
<1> Ibiwan depends on how you want to write this
<1> I'd think that a regular iterator would be the most useful
<1> so you can just "walk" through the collection in some (predictable) order
<3> yeah, that's what I was going to do right after I got the collection
<3> have that code written already, in fact
<1> put it all in an iterator cl*** them
<1> err, then
<3> okay, so I p*** my function an object of type T, it uses whatever internal logic to come up with several more objects of the same type, puts them in...
<3> you're saying "an iterator cl***"
<3> I was going to have it put them in a vector<T>
<1> if your "object" is a container, then yes you shouldhave an iterator for the container
<5> I put up a post on www.noidea128.org
<5> i have a really simple windows application that draws nothing (when it should draw a little plane i manually drew)
<5> i could fix this normally by finding my small error with example code, but im at work and cant access it
<3> T is not a list type, it's some custom node descriptor
<5> so if someone could look and see if they know why it doesnt seem to draw i would appreciate it.
<5> (im drawing to offscreen dc, and in wm_paint in just copying from it)
<3> so I p*** successor() a node, and want a set of nodes back, in no particular order
<3> I was just going to return a vector<node>
<3> you say to return the vector's address, that's fine
<1> Ibiwan do whatever you want...I'm suggesting that perhaps you arenlt looking at thigns right
<1> NO I said vector<node*>
<3> okay, that's why I'm trying to clarify, be patient, I'm not trying to ignore you :)
<3> alright, so I return a vector of pointers to nodes
<3> problem is, the function came from a user of the cl*** in the first place
<1> but if you're writing a container, I'd suggest that you look at the containers in the standard library and do as they do
<5> Khan has ops now?
<1> nacitar nah, we'd never be _that_ stupid
<5> peterhu == khan
<5> hehe
<4> fear me
<3> I'm not writing a container, at least not as I understand the term.
<1> peterhu time for another spelling lesson, that's ph34r
<3> not implementing my own linked list, for example -- I'd just use STL if I needed one
<4> ph34r m3
<1> but a node has some "next" ones
<3> right



<3> but those "nexts" aren't stored
<5> does anyone have time to briefly glance for stupid mistakes in my drawing code?
<1> that's very good, peterhu, pick one of the gold stars
<3> they're algorithmically generated
<4> w00t
<3> the "next" nodes don't exist until this function is called
<1> Ibiwan then go ahead an hand back objects
<3> okay
<3> :)
<3> so we're on the same page
<1> not really
<1> it's still a container
<3> are you defining "container" as any cl*** that contains data elements?
<5> Ibiwan, likely he means any cl*** that holds a _list_ of data elements
<5> and manages the list.
<1> no a _collection_ of them
<3> I'm not writing any collection cl***
<3> just keeping them in a vector
<1> when you lean to abstract some more, we'll discuss whether this is a collection of nodes or not
<3> alright, I'll go put some pseudocode on a paste site
<3> or was that "learn"?
<1> Ibiwan the fact that the nodes don't exist until you do .next() isn't relevant to whether it's a collection
<1> and it was supposed to be learn
<5> guess ill have to wait til i can get to my archive of old code to fix my problem =/.
<6> http://direct.motorola.com/ENS/web_producthome_SX700R.asp?Country=USA&language=ENS
<6> that's my new toy
<6> I had a gift certificate to use up
<6> my 5 mile guys just weren't cutting it too often.
<5> Noidea128: how much change did you have to throw at that.
<6> they're only $70
<3> alright, here's what I'm implementing
<1> each?
<3> http://pastebin.ca/37643
<6> no
<0> Can't you just use your mobile phone?
<6> for the pair.
<5> Noidea128, for a pair?
<3> expand() is the function I'm trying to write now
<5> cool.
<6> Ashe, no
<1> that's not bad at all
<6> not in the mountains, or the wilderness
<3> s, s', and n are of type "node"
<5> i dont see a buy option there though
<5> where'd you buy it from?
<6> Frys
<5> oh nvm im blind
<5> "buy this product"
<3> succ should be some collection of nodes, I was using vector<node>
<6> I got them from a store near my office.
<0> Dunno, mobile phone coverage is like 100% here
<6> there's not 100% coverage in the US
<6> and I'd be surprised to find that any country has coverage in the wilderness
<0> There's not much wilderness in Europe
<7> question: let's say i want to declare the following: some_type variable_name
<6> ahh
<5> Noidea128: "This two-way radio requires an FCC license, as do all GMRS two-way radios."
<5> that's lame.
<7> but i need the variable_name to be random and disposable...
<1> why not have expand put the things directly into p
<7> any ideas?
<6> whatever nacitar
<0> Why would you need a variable name to be random
<1> i.e. expand(n, p)
<6> let the FCC track me down.
<7> lol.. not by choice :P told to do so :)
<7> just make a random string and do it?
<0> There's no preprocessor random thing
<7> ah ok
<3> because the user p***es in expand() and p is my private data structure -- they can't touch it
<7> crapola
<0> Who told you to do that?
<5> Clickers: why would you need to do that?
<1> Ibiwan having them create a collection, simply so you can copy it to yours seems folly


Name:

Comments:

Please enter the result of the sum 63 + 46 (to avoid spam):






Return to #c++
or
Go to some related logs:

javascript onpageload
#AllNiteCafe
#AllNiteCafe
lpsg.org
ismini mauritius
gentoo clips ai
#linux
doomgazer
virus_86
tariqroadsale.com



Home  |  disclaimer  |  contact  |  submit quotes