[Semi OT] Language for Game Development talk

Walter Bright via Digitalmars-d digitalmars-d at puremagic.com
Sun Sep 28 19:46:49 PDT 2014


On 9/28/2014 1:25 PM, H. S. Teoh via Digitalmars-d wrote:
> 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.

https://issues.dlang.org/show_bug.cgi?id=7625



More information about the Digitalmars-d mailing list