This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [tuples] GS_BIND, GS_TRY, and minor API changes


I don't understand option 1.  How do you insert in the middle of a
list if you don't where to? Or is that not how
bsi_insert_{before/after} are used?

On 7/17/07, Aldy Hernandez <aldyh@redhat.com> wrote:
> Well, it seems more useful to include gs_seq_insert_before and
> gs_seq_insert_after.  We'll need them to implement bsi_insert_before and
> bsi_insert_after.  But I guess it doesn't hurt if we leave it for now.

For gs_seq_insert_{before,after} which do you suggest:

        gs_seq_insert_*(seq, item_to_insert);
or
        gs_seq_insert_*(seq, item_where_to_start, item_to_insert);

The 2nd option requires us to traverse the list to find the
item_where_to_start in the sequence, as sequences only have first/last
information.  The 1st option is pretty much a push and an append.

Aldy



Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]