MatchReturnType

Match functions return type

This template match the return type of the passed functions and fail if there's more than one type (except typeof(null))

template MatchReturnType (
funcs...
) if (
allSatisfy!(isSomeFunction, funcs)
) {}

Members

Aliases

MatchReturnType
alias MatchReturnType = types[0]
Undocumented in source.
types
alias types = NoDuplicates!(staticMap!(Unqual, staticMap!(ReturnType, funcs)))
Undocumented in source.

Examples

alias TL_1 = MatchReturnType!(void delegate(), void function(), void function(
		string foo));
assertTrue(is(TL_1 == void));
assertFalse(is(TL_1 == string));

alias TL_2 = MatchReturnType!(string delegate(), string function(), string function(
		int foo), () => null);
assertTrue(is(TL_2 == string));
assertTrue(is(MatchReturnType!(() => "atum") == string));

Meta