Question about auto ref

Namespace rswhite4 at googlemail.com
Mon Mar 25 15:35:06 PDT 2013


> Because the number of instantiations of the template could grow 
> exponentially
> as the number of auto ref parameters grows. Being able to use 
> the trick with
> the temporary with templated functions could really help reduce 
> template bloat
> when the current meaning of auto ref is not necessary, but that 
> means coming
> up with a new attribute rather than reusing auto ref with 
> non-templated
> functions.
I use the "trick" with the temporary. But why introduce rather a 
new attribute?
I thought the real reason why auto ref was first introduced was 
to solve the rvalue ref problem. Now we could do it. So what's 
wrong with auto ref for non-
template functions?
I'm afraid that the introducing of a new attribute means to spend 
a lot of time. Is that really needed? :/ Or am I wrong?

> Andrei is flat out against this. I wouldn't expect that te over 
> happen.
Good to know.

> We pretty much need a new attribute. IIRC, Kenji had a 
> suggestion for what it
> would be, but I don't remember what it was now. I'd have to go 
> digging through
> the archives to find it.
>
> - Jonathan M Davis

I haven't heard of it.
Would be very nice if you could do it and post the link. :)


More information about the Digitalmars-d-learn mailing list