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: RFA: Please review the new C++ demangler patch


dewar@gnat.com (Robert Dewar) writes:

| > Excuse me, but std::vector is everything except a high-level abstraction. 
| > It is C++ was of writing
| > 
| >    malloc (some number);
| >    while (not done) {
| >      fiddle with memory;
| >      reallaoc (memory, another number);
| >    }
| >    free (memory);
| 
| so why not say so and avoid the problem of using these components.

Becase the "fiddling with memory" part is a real mess, and
unnecessarily complicates the coding of the core algorithm.  The
alternatives are to use obstack, which are even messier. 

| I certainly
| agree that vector is not from a *language* point of view high level, but from
| an implementation point of view, it certainly is high level.

Actually, I was not even considering std::vector from a language point
of view, I was speaking as a C++ user.  Realistically, one needs to
maintain a variably-sized array of strings which is a very low level
abstraction (from user point of view).

-- Gaby


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