🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: gnu.g++.help
Article #726

Warning flags...

#726
From: 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'
Technical Details
Message-ID: <3024322b0.324@omnifarious.omnifarious.mn.org.omnifarious.mn.org>
Path: arc1-ca.pugleaf.net!omnifarious.mn.ORG!hopper

Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!omnifarious.mn.ORG!hopper
From: hopper@omnifarious.mn.ORG (Eric M. Hopper)
Newsgroups: gnu.g++.help,comp.lang.c++
Subject: Warning flags...
Date: 5 Aug 1995 23:04:00 -0400
Organization: Gatewayed from the GNU Project mailing list help-g++@prep.ai.mit.edu
Sender: daemon@cis.ohio-state.edu
Distribution: world
Message-ID: <3024322b0.324@omnifarious.omnifarious.mn.org.omnifarious.mn.org>