changed TernaryType metafunction to use self instead of cls, to satisfy the code review tools