baud@gt-eedsp.UUCP (Kurt Baudendistel) (01/28/89)
it is very interesting to note that the current development path
of c++ seems to include a large degree of (1) removal of restrictions
on current language features [initialization of static class members,
etc.] and (2) generalization of constructs to make programming
in c++ ``easier'' [parameterized classes, multiple inheritence, etc.].
of course, we all applaud such developments! however, my question is
whether some of the other nasty restrictions will be removed in the near
future, or whether there are intrinsic reasons behind them:
1. single level of coercion of types.
an example of a place where this
problem is a real bear is when you want to implement an alternate
arithmetic class (fixed point, real, etc.) and then use it in a
containerized version (vector, complex, etc.). seemingly simple
things like ``0.'' become real problems of code management
without multiple levels of coercion.
where there is an unambigous coercion path, why can't it be
used? a single level seems to be an artificial barrier.
2. only zero-argument constructors are allowed for definition of arrays.
if i want to create an array of a type that requires some argument,
i have to kludge around this restriction by creating a zero-argument
constructor that uses an external value. then i set the external value
with some other routine.
3. it is obvious that construction and assignment operations are not
the same, and we have two different operators, the constructor and
operator= which reflects this. what is not obvious, until you've tried
it, is that there are various uses for constructors: variable
definition, argument passing, and return value passing.
will the different uses of constructors ever be definable for their
particular use? in other words, will there ever be more than one
type of constructor?
what do you think should happen to these issues? are there any restrictions
in c++ that really get your goat?
kurt
--
Kurt Baudendistel --- GRA
Georgia Tech, School of Electrical Engineering, Atlanta, GA 30332
uucp: ...!{allegra,hplabs,ulysses}!gatech!gt-eedsp!baud
internet: baud%gt-eedsp@gatech.edu