C++11

Cafe Alpha2 cafealpha2 at gmail.com
Sun Oct 2 21:11:09 CEST 2011


Warning microsoft visual studio 2010 allows c++0x syntax but doesn't
actually compile the rvalue code. From my tests it looks like it still calls
the lvalue code and makes unnecessary copies.
On Oct 2, 2011 11:32 AM, "Hans Aberg" <haberg-1 at telia.com> wrote:
> On 2 Oct 2011, at 20:07, Gabriel Dos Reis wrote:
>
>>>>>> Just on the off chance that you are suggesting dropping expression
templates and relying on copy elision and/or rvalue references to reduce the
number of temporaries:
>>>>> Yes, but there would still be a template for the memory allocation.
>>>>
>>>> I am sorry, I still don't understand what you are suggesting. What
template are you talking about? Do you mean to implement integers of fixed
size? Or is the template something like std::allocator?
>>>
>>> Right.
>>
>> Like Marc, I am having difficulty following your suggestions. There
>> were three questions
>> in the paragraph to which you replied "Right". Please, elaborate.
>
> The allocator template model probably does not work with GMP, as it sets
those globally.
>
> So the idea is to write "class integer" etc. using C++11 move copy &
assignment operators to avoid copying of temporaries.
>
> Hans
>
>
> _______________________________________________
> gmp-discuss mailing list
> gmp-discuss at gmplib.org
> https://gmplib.org/mailman/listinfo/gmp-discuss
>


More information about the gmp-discuss mailing list