- Beginning C# 7 Hands-On:Advanced Language Features
- Tom Owsiak
- 65字
- 2021-07-02 15:29:16
Introducing constraints
To compare values, you want to use the CompareTo method. It can be used if you have where T : IComparable. This is a new construct there. It's a constraint. The Compare method works, but it only does so if the data type on which it is operating has IComparable implemented on it. In other words, it makes sense to compare the values.
推薦閱讀
- Android Jetpack開(kāi)發(fā):原理解析與應(yīng)用實(shí)戰(zhàn)
- Azure IoT Development Cookbook
- 深入理解Django:框架內(nèi)幕與實(shí)現(xiàn)原理
- Mastering SVG
- 華為HMS生態(tài)與應(yīng)用開(kāi)發(fā)實(shí)戰(zhàn)
- Java從入門到精通(第4版)
- 區(qū)塊鏈:以太坊DApp開(kāi)發(fā)實(shí)戰(zhàn)
- Python王者歸來(lái)
- Learning OpenStack Networking(Neutron)
- C語(yǔ)言程序設(shè)計(jì)與應(yīng)用(第2版)
- 貫通Tomcat開(kāi)發(fā)
- 深度實(shí)踐KVM:核心技術(shù)、管理運(yùn)維、性能優(yōu)化與項(xiàng)目實(shí)施
- 現(xiàn)代CPU性能分析與優(yōu)化
- Python Automation Cookbook
- Go語(yǔ)言編程之旅:一起用Go做項(xiàng)目