delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1998/02/01/19:32:28

From: Bitland AT aol DOT com
Message-ID: <c2b00813.34d511b2@aol.com>
Date: Sun, 1 Feb 1998 19:22:08 EST
To: djgpp AT delorie DOT com
Mime-Version: 1.0
Subject: Two c++-parser problems

Found two C++-parserproblems, which *imho* shouldn't be there:

// ----- First one:

class A
{ public:
   char *string;

   A(char *s) : string(s) {}
};

class B : public A
{ public:
   B(void) : A("doesn't work here with language-specific letters !") {}
};
   // i.e. german letters in the string will produce 'parser error'
'unterminated string'

B test;

main()
{ A *test = new A("but here it works !");
  delete test;
}

// -----

Templates of templates:

i.e.:   MyList<MyArray<MyString>>     (oh yes, I do such things !)

Parser has problems with the final >>
No more problem, if you type a blank between there.

If somebody knows a solution for the first problem, please mail me.
Andy Kluge -- *\o/* --- Wiesbaden, Germany ---------- bitland AT aol DOT com

                     - - - - - - OOP is when flags are set at half-mast - - -
- - -

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019