從零開始開發(fā)億級(jí)流量小紅書項(xiàng)目實(shí)戰(zhàn)
class Maker{public: ? ?Maker(string name, int age) ? ?{ ? ? ? ?this->name = name; ? ? ? ?this->age = age; ? ?} ? ?// 模版函數(shù)局限性 解決方案2 重載運(yùn)算符 (最優(yōu)) ? ?// 重載>運(yùn)算符 ? ?bool operator>(Maker &b) { ? ? ? ?if (this->age > b.age) ? ? ? ?{ ? ? ? ? ? ?return true; ? ? ? ?}else{ ? ? ? ? ? ?return false; ? ? ? ?} 作者:巍啊itdaxue https://www.bilibili.com/read/cv25152945 出處:bilibili
標(biāo)簽: