problem with strings in 970929

Mark Mitchell mmitchell@usa.net
Thu Oct 2 00:03:00 GMT 1997


Kate --

  There are several problems:

  o std/bastring.h should include stl_config.h, before testing
    __STL_USE_EXCEPTIONS, but does not.
  o bastring.h includes <stdexcept> which contains code of the form

    struct s { string str; }

    Since string is not already defined, you run into trouble
    at this point.  We need to put off including <stdexcept> until
    after the definition of string. 

  I'm not quite sure of the best way to do this, so I haven't
attempted a patch.

>>>>> "Kate" == Kate Hedstrom <kate@ahab.Rutgers.EDU> writes:

    Kate> I tried this program (from the new Stroustrup book) on a
    Kate> freebsd system and it compiled with 970924:

    Kate> #include <iostream.h> #include <iterator.h> #include
    Kate> <string>

    Kate> ostream_iterator<string> oo(cout);

    Kate> int main() { *oo = "Hello, "; ++oo; *oo = "world!\n"; }


    Kate> Now I get:

    Kate> g++ --save-temps io1.cc In file included from
    Kate> /usr/local/include/g++/std/bastring.h:40, from



More information about the Gcc-bugs mailing list