On Tue, Apr 21, 2009 at 08:48:50PM +0200, Jean-Marc Lasgouttes wrote:
> Bernhard Roider writes:
>
> > Jean-Marc Lasgouttes schrieb:
> >
> >> Yes, but what if I keep a reference to the temporary variable that
> >> gets returned? Does my reference point to neverland?
> >
> > Yes it does. Or more pr
Bernhard Roider writes:
> Jean-Marc Lasgouttes schrieb:
>
>> Yes, but what if I keep a reference to the temporary variable that
>> gets returned? Does my reference point to neverland?
>
> Yes it does. Or more precisely it points to somewhere on the stack
> because local variables in functions are
Jean-Marc Lasgouttes schrieb:
Yes, but what if I keep a reference to the temporary variable that gets
returned? Does my reference point to neverland?
Yes it does. Or more precisely it points to somewhere on the stack because local variables in
functions are allocated on the stack. When the fu
If you "assign" some temporary (like a _copy_ returned from some
function) to a reference, the lifetime of that temporary will not
end at the end of the full expression (which usually marks the end of
life of temporaries), but will be extended to the end of the block
in which the reference is defi
On Mon, Apr 20, 2009 at 10:56:03PM +0200, Jean-Marc Lasgouttes wrote:
>> A function may not return a reference to a local variable. You should
>> at least get a warning.
>
> Yes, but what if I keep a reference to the temporary variable that gets
> returned? Does my reference point to neverland?
Now that i think about your arguments again: that was not the
problem here, but it is the answer for JMarc's question:
> OK, so all the changes were wrong. Now, how can I change my function
> signature to indicate that the return value is a temporary and
that an
> address should not be kept?
Bernhard Roider schrieb:
Abdelrazak Younes schrieb:
Jean-Marc Lasgouttes a écrit :
Le 20 avr. 09 à 00:25, Jean-Marc Lasgouttes a écrit :
Le 19 avr. 09 à 23:13, Abdelrazak Younes a écrit :
+docstring const fls = flattenLabelString(it->first,
false, callers);
docstring const & ?
Inde
Abdelrazak Younes schrieb:
Jean-Marc Lasgouttes a écrit :
Le 20 avr. 09 à 00:25, Jean-Marc Lasgouttes a écrit :
Le 19 avr. 09 à 23:13, Abdelrazak Younes a écrit :
+docstring const fls = flattenLabelString(it->first, false,
callers);
docstring const & ?
Indeed, thanks.
Now that I t
On Mon, Apr 20, 2009 at 12:03:42PM +0200, Jean-Marc Lasgouttes wrote:
> Abdelrazak Younes writes:
> > This essentially depends on bar(). If bar() generates a new string, it
> > should of course return a copy and you should not use a const ref. If
> > bar() returns a reference or a const reference
Jean-Marc Lasgouttes a écrit :
Abdelrazak Younes writes:
This essentially depends on bar(). If bar() generates a new string, it
should of course return a copy and you should not use a const ref. If
bar() returns a reference or a const reference to an internal string,
then you can save a copy by
Abdelrazak Younes writes:
> This essentially depends on bar(). If bar() generates a new string, it
> should of course return a copy and you should not use a const ref. If
> bar() returns a reference or a const reference to an internal string,
> then you can save a copy by using a const ref too.
O
Jean-Marc Lasgouttes a écrit :
Le 20 avr. 09 à 00:25, Jean-Marc Lasgouttes a écrit :
Le 19 avr. 09 à 23:13, Abdelrazak Younes a écrit :
+docstring const fls = flattenLabelString(it->first, false,
callers);
docstring const & ?
Indeed, thanks.
Now that I think of it, how come that we
On Mon, Apr 20, 2009 at 12:32:21AM +0200, Jean-Marc Lasgouttes wrote:
> Le 20 avr. 09 à 00:25, Jean-Marc Lasgouttes a écrit :
>> Le 19 avr. 09 à 23:13, Abdelrazak Younes a écrit :
+ docstring const fls = flattenLabelString(it->first, false,
callers);
>>> docstring const & ?
>>
Le 20 avr. 09 à 00:25, Jean-Marc Lasgouttes a écrit :
Le 19 avr. 09 à 23:13, Abdelrazak Younes a écrit :
+ docstring const fls = flattenLabelString(it->first, false,
callers);
docstring const & ?
Indeed, thanks.
Now that I think of it, how come that we have lots of
string const foo = ba
Le 19 avr. 09 à 23:13, Abdelrazak Younes a écrit :
+ docstring const fls = flattenLabelString(it->first, false,
callers);
docstring const & ?
Indeed, thanks.
JMarc
On 19/04/2009 22:05, lasgout...@lyx.org wrote:
Author: lasgouttes
Date: Sun Apr 19 22:05:26 2009
New Revision: 29342
URL: http://www.lyx.org/trac/changeset/29342
Log:
Speedup the expandLabel by avoiding the recursive part. The labelstrings
are computed recursively to get rid of any \thexxx strin
16 matches
Mail list logo