Giter Site home page Giter Site logo

Comments (4)

Barenboim avatar Barenboim commented on June 3, 2024

涉及STL的才用引用。另外就是运算符重载,只能用引用。
其它都是指针。

用上我们的项目的话,记得star噢。

from workflow.

liutaosgsg avatar liutaosgsg commented on June 3, 2024

您好,感谢回复,能进一步解释下为什么涉及STL的才用引用吗?如果不方便的话我自己查下资料也可以。

from workflow.

Barenboim avatar Barenboim commented on June 3, 2024

我们这种工厂模式,应该用指针比较方便吧。让函数返回一个引用也太奇怪了。原则上,我们任何自己的类,都不会有引用,除非是运算符重载。

至于stl的对象,我们一般是传值或传引用,因为这样才能做隐式转换,例如const std::string&的地方可以传入C的字符串。

本质上我们是一个c with class项目,会尽可能用更加原始的语言特征,只代表这个项目的风格而已。

from workflow.

Barenboim avatar Barenboim commented on June 3, 2024

@liutaosgsg 没有什么别的疑问我先关了。

from workflow.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.