[Issue 8640] Template struct/class member functions should compile conditionally
d-bugmail at puremagic.com
d-bugmail at puremagic.com
Tue Sep 11 08:01:24 PDT 2012
http://d.puremagic.com/issues/show_bug.cgi?id=8640
Don <clugdbug at yahoo.com.au> changed:
What |Removed |Added
----------------------------------------------------------------------------
CC| |clugdbug at yahoo.com.au
--- Comment #1 from Don <clugdbug at yahoo.com.au> 2012-09-11 08:01:50 PDT ---
This is as designed. Doing otherwise would let a lot of bugs through.
In fact one of the oldest open rejects-valid bug reports is a request to make
the compiler check template functions even when they are NOT called.
There are strong reasons for the current behaviour.
* This request would interact badly with functions which return auto (the
compiler needs to compile them, to find out what the return type is).
* It's impossible for classes (you need to put the function into the vtable,
regardless of whether it is called or not), making a new, surprising difference
between classes and structs.
Generally in these cases I just turn the function into a template function.
@property void front(Dummy = void)(T value)
{val = value;} //HERE
I never tested that with property functions though.
--
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
More information about the Digitalmars-d-bugs
mailing list