C#: Generic Interface for Numbers

后端 未结 2 1812
难免孤独
难免孤独 2021-01-18 14:07

I am trying to perform some generic number manipulation independent of the number type. However, I know of no way to use generics to do this. The first idea was to filter th

2条回答
  •  挽巷
    挽巷 (楼主)
    2021-01-18 14:28

    There's no common interface for arithmetic operations implemented by numeric types. Generic operators might help solving your problem.

提交回复
热议问题