💎一站式轻松地调用各大LLM模型接口,支持GPT4、智谱、星火、月之暗面及文生图 广告
# 4.设计与声明 Designs and Declarations [条款18:让接口容易被正确使用,不易被误用](/chapter4/section18.md) [条款19:设计 class 犹如设计 type](/chapter4/section19.md) [条款20:宁以 pass-by-reference-to-const 替换 pass-by-value](/chapter4/section20.md) [条款21:必须返回对象时,别妄想返回其 reference](/chapter4/section21.md) [条款22:将成员变量声明为 private](/chapter4/section22.md) [条款23:宁以 non-member、non-friend 替换 member 函数](/chapter4/section23.md) [条款24:若所有参数皆需类型转换,请为此采用 non-member 函数](/chapter4/section24.md) [条款25:考虑写出一个不抛异常的 swap 函数](/chapter4/section25.md)