CG members photo album - Page 107
CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Page 107 of 156 FirstFirst ... 75797104105106107108109110117 ... LastLast
Results 1,591 to 1,605 of 2339

Thread: CG members photo album

  1. #1591
    Join Date
    Oct 2002
    Location
    Germany
    Posts
    6,205

    Re: CG members photo album

    Quote 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?

  2. #1592
    Join Date
    Jun 2002
    Location
    Moscow, Russia.
    Posts
    2,176

    Re: CG members photo album

    Quote 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."

  3. #1593
    Join Date
    Oct 2002
    Location
    Germany
    Posts
    6,205

    Re: CG members photo album

    Quote Originally Posted by RoboTact
    Better use linked list, preferrably unidirectional.
    Secondly, are you sure that you want to do away with random access?

  4. #1594
    Join Date
    Jun 2002
    Location
    Moscow, Russia.
    Posts
    2,176

    Re: CG members photo album

    Quote 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."

  5. #1595
    Join Date
    Oct 2002
    Location
    Germany
    Posts
    6,205

    Re: CG members photo album

    Quote Originally Posted by RoboTact
    One can use vector of pointers.
    Well... A vector of pointers may result in more people using an object that the (original) owner trusts...

    Does anyone want a "wife" object that also implements thread-synchronization to service multiple clients?

  6. #1596
    Join Date
    Jun 2002
    Location
    Moscow, Russia.
    Posts
    2,176

    Re: CG members photo album

    Quote 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."

  7. #1597
    Join Date
    Oct 2002
    Location
    Germany
    Posts
    6,205

    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 05:50 PM.

  8. #1598
    Join Date
    Jun 2002
    Location
    Moscow, Russia.
    Posts
    2,176

    Re: CG members photo album

    Quote 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."

  9. #1599
    Join Date
    Oct 2002
    Location
    Germany
    Posts
    6,205

    Re: CG members photo album

    Quote 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.

  10. #1600
    Join Date
    Sep 2005
    Posts
    9

    Re: CG members photo album

    Quote 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..

  11. #1601
    Join Date
    Oct 2002
    Location
    Germany
    Posts
    6,205

    Re: CG members photo album

    Quote 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?

  12. #1602
    Join Date
    Sep 2005
    Posts
    9

    Re: CG members photo album

    Besides, clerics are allowed only 5... Right?
    no limit,I'm not a cleric ,I'm against them intensively

  13. #1603
    Join Date
    Oct 2002
    Location
    Germany
    Posts
    6,205

    Re: CG members photo album

    And... If one is not a cleric - how many wives is one allowed to keep?

  14. #1604
    Join Date
    Oct 2002
    Location
    Timisoara, Romania
    Posts
    14,360

    Re: CG members photo album

    Quote 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.
    Marius Bancila
    Home Page
    My CodeGuru articles

    I do not offer technical support via PM or e-mail. Please use vbBulletin codes.

  15. #1605
    Join Date
    Sep 2005
    Posts
    9

    Re: CG members photo album

    dpends on money and such things.....

Page 107 of 156 FirstFirst ... 75797104105106107108109110117 ... LastLast

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  


Windows Mobile Development Center


Click Here to Expand Forum to Full Width

This is a CodeGuru survey question.


Featured


HTML5 Development Center