[gnu.g++] error/warning message generation in c++

baud@gt-eedsp.UUCP (Kurt Baudendistel) (07/19/88)

the #error preprocessor directive is a powerful tool for the programmer.
this is especially true for the author of library (#include'd) files.

however, the introduction of classes by c++ creates a new class of
problems for error message generation that #error does not address.

in the definition of classes (data types) to be included via libraries,
the author should provide some measure of error message generation to
deal with common problems.  for example, the author of a fixed point
class that does not contain the division operator '/' should have his
class generate a meaningful error message upon its attempted use
rather than the typical c++ `operator double () conversion not defined
for class fixed_point' message.

the only current method for dealing with this problem is generation
of a run time error message when the '/' operator is used in a user
program.  this is undesirable since the error message does not occur
at compile time.

what is a good solution to this dilemna?

-- 
Kurt Baudendistel [GRA McClellan]
Georgia Tech, School of Electrical Engineering, Atlanta, GA  30332
USENET: ...!{allegra,hplabs,ihnp4,ulysses}!gatech!gt-eedsp!$me
INTERNET: $me@gteedsp.gatech.edu