[Semi OT] Language for Game Development talk

H. S. Teoh via Digitalmars-d digitalmars-d at puremagic.com
Sun Sep 28 13:25:07 PDT 2014


On Sun, Sep 28, 2014 at 10:19:36AM -0700, Walter Bright via Digitalmars-d wrote:
[...]
> Inlining is not a random thing. If there's a case that doesn't inline,
> ask about it.
[...]

This is not directly related to this thread, but recently in a Phobos PR
we discovered the following case:

	// This function gets inlined:
	int func1(int a) {
		if (someCondition) {
			return value1;
		} else {
			return value2;
		}
	}

	// But this one doesn't:
	int func2(int a) {
		if (someCondition) {
			return value1;
		}
		return value2;
	}

IIRC Kenji said something about the first case being convertible to an
expression, but the second can't. It would be nice if inlining worked
for both cases, since semantically they are the same.


T

-- 
Famous last words: I *think* this will work...


More information about the Digitalmars-d mailing list