Typescript: infer type of generic after optional first generic

You want something like partial type parameter inference, which is not currently a feature of TypeScript (see microsoft/TypeScript#26242). Right now you either have to specify all type parameters manually or let the compiler infer all type parameters; there’s no partial inference. As you’ve noticed, generic type parameter defaults do not scratch this itch; a default … Read more

How much is too much with C++11 auto keyword?

I think that one should use the auto keyword whenever it’s hard to say how to write the type at first sight, but the type of the right hand side of an expression is obvious. For example, using: my_multi_type::nth_index<2>::type::key_type::composite_key_type:: key_extractor_tuple::tail_type::head_type::result_type to get the composite key type in boost::multi_index, even though you know that it is … Read more

Why doesn’t C# infer my generic types?

A bunch of people have pointed out that C# does not make inferences based on constraints. That is correct, and relevant to the question. Inferences are made by examining arguments and their corresponding formal parameter types and that is the only source of inference information. A bunch of people have then linked to this article: … Read more