ConstantFunction is a ContinuousMap that only ever returns one fixed value. It's innately indifferent to its TIn type.
Write a generic implicit cast to convert any ConstantFunction<TIn, TOut> to ConstantFunction<TIn2, TOut> for arbitrary TIn and TIn2 types, since the ConstantFunction doesn't use its input. The same function should be declared for a cast to ContinuousMap<TIn2, TOut>, since I'm not sure whether an upcast will implicitly combine with a user-defined conversion operator.
ConstantFunction is a ContinuousMap that only ever returns one fixed value. It's innately indifferent to its TIn type.
Write a generic implicit cast to convert any
ConstantFunction<TIn, TOut>
toConstantFunction<TIn2, TOut>
for arbitraryTIn
andTIn2
types, since the ConstantFunction doesn't use its input. The same function should be declared for a cast toContinuousMap<TIn2, TOut>
, since I'm not sure whether an upcast will implicitly combine with a user-defined conversion operator.