How to define generic type limit to primitive types?

后端 未结 5 1413
清歌不尽
清歌不尽 2020-12-03 00:13

I have the following method with generic type:

T GetValue();

I would like to limit T to primitive types such as int, string, float

5条回答
提交回复
热议问题