octave-bug-tracker
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Octave-bug-tracker] [bug #46536] Bad indexing could produce more inform


From: John W. Eaton
Subject: [Octave-bug-tracker] [bug #46536] Bad indexing could produce more informative error messages
Date: Tue, 15 Dec 2015 00:44:39 +0000
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Firefox/38.0 Iceweasel/38.2.1

Follow-up Comment #9, bug #46536 (project octave):

I generally don't like the idea of returning const reference.  Currently that
would work because the object being returned is a tree_index_expression data
member, so it will be live for as long as expr is (in the context we are
discussing).  But what if tree_index_expression::arg_names were changed so
that instead of returning a data member, it created a temporary value to
return?  Then I don't think returning a const reference to a temporary would
help you.  In that case I don't think there would be any guarantee that the
reference would be valid after the arg_names method returns.  So please leave
it returning a std::list<> object and just make a temporary that has the
lifetime you need.

    _______________________________________________________

Reply to this item at:

  <http://savannah.gnu.org/bugs/?46536>

_______________________________________________
  Message sent via/by Savannah
  http://savannah.gnu.org/




reply via email to

[Prev in Thread] Current Thread [Next in Thread]