Apparently this is a supported and even idiomatic way of keeping a
temporary object (e.g. like that returned from an operator
dereference) alive.
if (i == end)
return NULL;
- std::string term = *i;
+ const std::string &term = *i;
if (strncmp (term.c_str(), prefix, prefix_len))
return NULL;
unsigned int directory_id;
const char *direntry, *directory;
char *colon;
- const std::string term = *i;
+ const std::string &term = *i;
/* Terminate loop at first term without desired prefix. */
if (strncmp (term.c_str (), direntry_prefix, direntry_prefix_len))