KnowledgeHub
Questions
Tags
Users
Search
Alex Rivera
|
Logout
Edit Question
Title
Body
I have a function like this const string &SomeClass::Foo(int Value) { if (Value < 0 or Value > 10) return ""; else return SomeClass::StaticMember[i]; } I get warning: returning reference to temporary . Why is that? I thought the both values the function returns (reference to const char* "" and reference to a static member) cannot be temporary.
Tags (comma-separated)
Save Edits
Cancel