This is the mail archive of the
libstdc++@gcc.gnu.org
mailing list for the libstdc++ project.
Re: verbose terminate() on by default, pass 2
Phil Edwards <phil@jaj.com> writes:
| On Wed, Dec 25, 2002 at 09:23:40AM +0100, Gabriel Dos Reis wrote:
| > Nathan Myers <ncm-nospam@cantrip.org> writes:
| > | > + char const *w = exc.what();
| > | > + type_info *t = __cxa_current_exception_type();
| > | > + char const *name = t->name();
| > | > + char *dem = 0;
| > | > + catch (exception &exc)
| > | > + char const *w = exc.what();
| > |
| > | This is C++ code. Shouldn't we have C++-style declarations?
| >
| > 100% agreed.
|
| I hadn't really planned on rewriting Jason's code... what specifically are
| you disagreeing with?
Nathan and I are talking about the fact that C++-STYLE emphasizes types
and that V3 uses (mostly) the style from the C++ Standard.
01. Pointers and references
char* p = "flop";
char& c = *p;
-NOT-
char *p = "flop"; // wrong
char &c = *p; // wrong
Reason: In C++, definitions are mixed with executable code. Here,
p is being initialized, not *p. This is near-universal
practice among C++ programmers; it is normal for C hackers
to switch spontaneously as they gain experience.
The style used on V3 is "const T*" not "T const *".
-- Gaby