Boost: Use Of Non-Dynamic Data Structures?

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Chris Gordon-Smith

    #1

    Boost: Use Of Non-Dynamic Data Structures?

    I have recently started using the Boost Graph Library(BGL);
    overall I am finding it excellent and very powerful.

    One thing worries me a little. It seems to be standard practice
    when using BGL to create a data structure with a specific size,
    and then pass a pointer (or iterator) to the start of that data
    structure to an algorithm as an argument.

    Is this OK? Isn't it better to dynamically allocate memory for
    containers according to need, or am I missing the point?

    --
    Chris Gordon-Smith
    London
    Origin Of Life, Chris Gordon-Smith, Oparin, Haldane, Primordial Soup, Artificial Chemistry, Flexica, Cellular Automata

  • Chris Gordon-Smith

    #2
    Re: Boost: Use Of Non-Dynamic Data Structures?

    Chris Gordon-Smith wrote:
    I have recently started using the Boost Graph Library(BGL);
    overall I am finding it excellent and very powerful.
    >
    One thing worries me a little. It seems to be standard practice
    when using BGL to create a data structure with a specific size,
    and then pass a pointer (or iterator) to the start of that data
    structure to an algorithm as an argument.
    One thing I should have made clear in the original posting: The algorithm
    then populates the data structure that the argument points to. My concern
    is that if the data structure was created with the wrong size, there will
    be trouble.
    >
    Is this OK? Isn't it better to dynamically allocate memory for
    containers according to need, or am I missing the point?
    >

    Comment

    Working...