Hello, I am still fighting with C++ references! Lets say we have this:
Qt Code:
class Foo { public: Foo(Bar& b); private: Bar m_bar; }; Foo::Foo(Bar& b) : m_bar(b) {}To copy to clipboard, switch view to plain text mode
- Should the constructor better have the parameter as value instead of reference?
- Since I am using the constructor initialization list, would there be a performance difference?
- Would there be a semantic difference? e.g., to the caller of new Foo
Thank you again
Bookmarks