Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
const标记函数与标记类有什么区别const&?
const
const&
例如:
class abc { Private: std::string str; Public: const std::string& foo(const int&) const&; const std::string& bar(const int&) const; }
它们之间有什么区别吗?您什么时候会使用其中一种?