What is that "enum function" supposed to be ?

H. S. Teoh hsteoh at quickfur.ath.cx
Mon Jul 19 22:28:01 UTC 2021


On Mon, Jul 19, 2021 at 09:16:57PM +0000, Elmar via Digitalmars-d wrote:
[...]
> 	enum barz(int x) {  // fine
> 		return x;
> 	}
[...]

That's hilarious.  Part of me almost wants to suggest this as syntax for
CTFE-only functions. :-D  I.e.,

	enum fun(int x) { ... }

would be equivalent to:

	auto fun(int x) {
		if (_ctfe) { ... }
		else assert(0);
	}


T

-- 
"I'm running Windows '98." "Yes." "My computer isn't working now." "Yes, you already said that." -- User-Friendly


More information about the Digitalmars-d mailing list