Topic: Are these standard code?


Author: davidm@consilium.com (David S. Masterson)
Date: 9 Apr 93 01:53:50 GMT
Raw View
I'm looking for information on what the standard says (or will say) about the
following coding practices:

1. Declaring a method without 'inline' in the class declaration and then
redefining it to be 'inline' when the method is later defined.  Oregon C++
allows it, DEC C++ calls it an error.  I prefer it to be allowed as its a hint
to the compiler for efficiency and not something the user of the object needs
to worry about.

2. Defining an 'operator charp()' (where 'charp' is typedef'ed to char*) on a
class and then passing an object of that class to a function requiring a
'const char*' (strcmp(1)).  Oregon C++ allows it, DEC C++ ignores the operator
and calls it an error.  I don't want to use an explicit cast.

This is on VMS 5.5 with Oregon C++ 2.1 and DEC C++ 3.0.
--
====================================================================
David Masterson     Consilium, Inc.
(415) 691-6311     640 Clyde Ct.
davidm@consilium.com    Mtn. View, CA  94043
====================================================================
"In addition I think science has enjoyed an extraordinary success
 because it has such a limited and narrow realm in which to focus its
 efforts.  Namely, the physical universe."
-- Ken Jenkins