Type-only template argument to lambda
问题 Imagine I've got this struct: struct Foo { operator int() { return 11; } operator unsigned int() { return 22; } } foo; When this struct is casted to an int, it returns 11, but when casted to an unsigned int, it returns 22. Using normal functions, I could use templates and a getter function to choose: template<typename T> T get() { return (T)foo; } Now, when calling this function like get<int>() it would return 11 , but when calling it like get<unsigned int>() it would return 22 . Everything's