This is the mail archive of the gcc@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: Using C++ in GCC is OK


Jakub Jelinek <jakub@redhat.com> writes:

> But do we really want to use std::vector?  The vec.h, appart from
> having ugly syntactic sugar, seems to be more space efficient, has better
> aliasing properties (given that it is just one pointer, you can e.g. use
> restrict on it easily) and seems to have more operations than std::vector has
> (std::vector has 3 pointers, while vec is just one pointer + 2 unsigned
> ints, I don't see counterparts to operations like VEC_quick_push or
> VEC_unordered_remove).

std::vector can be printed by gdb today.  Admittedly we could add
similar support for VEC.  The std::vector operations are shorter and
easier to read and write.

VEC_quick_push is implemented by std::vector::reserve and
std::vector::push.  VEC_unordered_remove is easy enough to write using
std::vector::operator[] and std::vector::pop.

Ian


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