query: How to duplicate a function which returns const reference by a function which returns non-const reference?
positive_passages.docid: 6559
positive_passages.text: How do I remove code duplication between similar const and non-const member functions?
negative_passages.docid: 68872
negative_passages.text: What are the use cases for having a function return by const value for non-builtin type?
negative_passages.docid: 13455
negative_passages.text: Why having const and non-const accessors?
negative_passages.docid: 78469
negative_passages.text: Is a closure for dereferencing variables useful?
negative_passages.docid: 94304
negative_passages.text: How does the const constructor actually work?
negative_passages.docid: 138830
negative_passages.text: What does `invalid initialization of non-const reference` mean?
negative_passages.docid: 30274
negative_passages.text: Why does flowing off the end of a non-void function without returning a value not produce a compiler error?
negative_passages.docid: 55329
negative_passages.text: Can I get a non-const C string back from a C++ string?
negative_passages.docid: 42055
negative_passages.text: Overload a C++ function according to the return value
negative_passages.docid: 12036
negative_passages.text: Does the 'mutable' keyword have any purpose other than allowing the variable to be modified by a const function?
negative_passages.docid: 142305
negative_passages.text: i want to write a reusable function
negative_passages.docid: 28186
negative_passages.text: C/C++ changing the value of a const
negative_passages.docid: 107469
negative_passages.text: What is the best way to return an error from a function when I'm already returning a value?
negative_passages.docid: 150233
negative_passages.text: Why doesn't reference-to-member exist in C++?
negative_passages.docid: 125985
negative_passages.text: Why does this const member function allow a member variable to be modified?
negative_passages.docid: 138804
negative_passages.text: Calling a const function from a non-const object
negative_passages.docid: 111309
negative_passages.text: Why is std::function not equality comparable?