-
June 9th, 2006, 03:33 PM
#1591
Re: CG members photo album
Originally Posted by RoboTact
Can you imagine the process of reallocation of array of wives? Better use linked list, preferrably unidirectional.
Aren't you assuming that a wife isn't a POD?
-
June 9th, 2006, 03:47 PM
#1592
Re: CG members photo album
Originally Posted by Siddhartha
Aren't you assuming that a wife isn't a POD?
Sure, there's whole bunch of links to stuff, several bags at the least, with complex shared ownership issues. It's a vain try not to lose any resources.
"Programs must be written for people to read, and only incidentally for machines to execute."
-
June 9th, 2006, 03:51 PM
#1593
Re: CG members photo album
Originally Posted by RoboTact
Better use linked list, preferrably unidirectional.
Secondly, are you sure that you want to do away with random access?
-
June 9th, 2006, 04:10 PM
#1594
Re: CG members photo album
Originally Posted by Siddhartha
Secondly, are you sure that you want to do away with random access?
One can use vector of pointers. Much safer, and you can use garbage collector to dispose of ones you removed pointers to instead of utilizing that unfair COM principle "deal with acquired problems yourself". :evil grin:
"Programs must be written for people to read, and only incidentally for machines to execute."
-
June 9th, 2006, 04:16 PM
#1595
Re: CG members photo album
-
June 9th, 2006, 04:31 PM
#1596
Re: CG members photo album
Originally Posted by Siddhartha
Well... A vector of pointers may result in more people using an object that the (original) owner trusts...
Not if you mastered encapsulation.
"Programs must be written for people to read, and only incidentally for machines to execute."
-
June 9th, 2006, 04:33 PM
#1597
Re: CG members photo album
Trusting one's encapsulation, and leaving a precious resource in the open makes for what I'd call a security flaw...
The good thing is that you've managed to get off list and on to vector... And the rest is detail.
Besides all this - one needs to post at least one photo in this thread to gain rights in discusing off-topic issues...
Last edited by Siddhartha; June 9th, 2006 at 04:50 PM.
-
June 9th, 2006, 04:51 PM
#1598
Re: CG members photo album
Originally Posted by Siddhartha
You?
Trusting one's encapsulation, and leaving a precious resource in the open makes for what I'd call a security flaw...
Besides all this - one needs to post at least one photo in this thread to gain rights in discusing off-topic issues...
I mean has-a relation without exposing unnecessary detailes does it.
"Programs must be written for people to read, and only incidentally for machines to execute."
-
June 9th, 2006, 04:53 PM
#1599
Re: CG members photo album
Originally Posted by RoboTact
I mean has-a relation without exposing unnecessary detailes does it.
Its simpler to hold by value... And if one plans to hold so many that performance lost to resizing matters - use std::vector::reserve.
However, I personally think that there ought to be no collection... The place holder for a wife is at best a singleton class.
-
June 10th, 2006, 05:36 AM
#1600
Re: CG members photo album
Originally Posted by SiddHartha
Next wife?!
How many exist in your collection presently?
(Counting is simple for std::vector <wife> myWives; call myWives.size (). No, it doesn't return the physical dimension of any wife, rather only the number of them.)
yes, next wife 10,20,30 like clerics..
-
June 10th, 2006, 05:39 AM
#1601
Re: CG members photo album
Originally Posted by Melvik12
yes, next wife 10,20,30 like clerics..
You aren't a cleric - are you?
Besides, clerics are allowed only 5... Right?
-
June 10th, 2006, 06:18 AM
#1602
Re: CG members photo album
Besides, clerics are allowed only 5... Right?
no limit,I'm not a cleric ,I'm against them intensively
-
June 10th, 2006, 06:20 AM
#1603
Re: CG members photo album
And... If one is not a cleric - how many wives is one allowed to keep?
-
June 10th, 2006, 06:27 AM
#1604
Re: CG members photo album
Originally Posted by Siddhartha
And... If one is not a cleric - how many wives is one allowed to keep?
A std::vector<ClericWife>. But the container must be private.
-
June 10th, 2006, 06:29 AM
#1605
Re: CG members photo album
dpends on money and such things.....
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|