Skip to content

add explicit type cast in ?: ternary operator

Summary

Add an explicit cast to the known return type in a ?: operator for the case that no common-type is available to the compiler

Details

When using non-pod types as range type in localfunctions, like Float128, it may be that the ternary operator bool ? Float128 : int (or with interchanged arguments) can not be used, since the compiler can not deduce the return type of this operator. Since the return type is known in some functions, it can be used here directly to case the arguments of the ternary ?:.

Edited by Simon Praetorius

Merge request reports

Loading