help-bison
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: C++ / multiple instances / iostreams


From: Hans Aberg
Subject: Re: C++ / multiple instances / iostreams
Date: Mon, 26 Jul 2004 19:50:59 +0200

At 00:29 +0200 2004/07/26, Detlef Vollmann wrote:
>> >23.2.1.3p1 explicitely requires that no references to elements
>> >in a deque are invalidated on an insert at the end or beginning.
>> >This effectively forbids reallocation.
>>
>> OK. They have then added some extra conditions on the notion of a deque.
>Agreed, the name just reflects the different interface
>(you also have push/pop_front), while for me the main
>difference is in the implementation.  I often use std::deque
>just because this different implementation, even if I don't
>need the double-ended interface.

I might then change back and use the std::deque (or std::stack which uses
the deque) as default for the Bison parser stack then.

>> >23.2.4p1 requires "The elements of a vector are stored contiguously",
>> >this effectively requires reallocation if the vector needs to grow.
>>
>> My copy of the standard does not say that. In fact, I could not find the
>> word contiguous in the containers section.
>Though a vector was always meant to be contiguous, it was forgotten
>in the original text.  This is the theme of one of the earliest
>defect reports
> http://www.open-std.org/jtc1/sc22/wg21/docs/lwg-defects.html#69
>It's part of the Technical Corrigendum (TC1), and therefore
>part of the second edition ISO/IEC 14882:2003(E), sometimes
>called C++03.

I guess that they have their reasons for this, even though it seems to be a
wholly unnecessary thing, in view of the automated interfaces one can build
in C++ (which are difficult to do in C).

As for which container to use in the Bison C++ parser stack, one must use a
conservative interface there, as features that depends on a certain type of
implementation (like an array block) will be hard to support in a
multilingual context. So apart from supplying a default implementation, and
giving the user that chance to change it, one cannot go beyond that.

  Hans Aberg






reply via email to

[Prev in Thread] Current Thread [Next in Thread]