Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.misc -> how to copy sql_context safely

how to copy sql_context safely

From: ChoongHwan Lee <linus81_at_intizen.com>
Date: 10 May 2004 21:37:42 -0700
Message-ID: <39e10c04.0405102037.5947b9a8@posting.google.com>


Hello

I use C++'s std::vector<sql_context>-like array in my C program. In the array, I'd like to manage "sql_context"s. What I said vector-like means that sql_context in this array may be copied to another place in the future if the number of elements exceed the capacity of array; for example,

    std::vector<sql_context> v;

    v.push_back(sql_context1);
    v.push_back(sql_context2);
    v.push_back(sql_context3);
     ...
    v.push_back(sql_context_n);

if I continue to push_back(), std::vector<> will reallocate new enough array and free old array. Assuming that sql_context doesn't have constructor or destructor, std::vector<> will copy every sql_context as it is. I don't know if this simple copy does harm. If it is not safe, how can I safely implement vector? Received on Mon May 10 2004 - 23:37:42 CDT

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US