🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

1 total messages Started by Eric M. Hopper Sun, 06 Aug 1995 03:04
Warning flags...
#726
Author: Eric M. Hopper
Date: Sun, 06 Aug 1995 03:04
32 lines
1767 bytes
	I want a warning flag that gives a warning every time an implicit
conversion is done to call a function.  I actually would like a flag that
makes such implicit conversion an error.  C++'s overloading rules are overly
complex, and annoying.  I want to turn off implicit conversions in order to
simplify them.

	Of course, I don't want certain conversions killed, as they are
almost never harmful.  In particular:

A	-> A &		I don't even consider this a conversion.
D *	-> B *		Where D is derived from B.
D &	-> B &		Where D is derived from B.
A	-> const A	addition of const is hardly ever a problem.
A	-> volatile A	addition of volatile is hardly ever a problem.
A *	-> const A *	See above
A *	-> volatile A *	See above
A &	-> const A &	See above
A &	-> volatile A &	See above

	In the last six, A doesn't have to be a simple type.  It could be a
compound type like B *, and adding const would make it B const *.

	I would like to be able to do (formerly) implicit conversions using a
new implicit_cast<T> construct.  The conversion would give an error at
compile time if the conversion wasn't able to be performed implicitly under
the old implicit casting rules.

Have fun, (if at all possible)
--Me (Eric Hopper)
Fare well, wherever you fare, and may your aeries receive you at your
journey's end.
--J.R.R. Tolkien  'The Hobbit'
Thread Navigation

This is a paginated view of messages in the thread with full content displayed inline.

Messages are displayed in chronological order, with the original post highlighted in green.

Use pagination controls to navigate through all messages in large threads.

Back to All Threads