Re: [Libreoffice-commits] Revert "sorted_vector: turn Find parameter into template"

classic Classic list List threaded Threaded
2 messages Options
sberg sberg
Reply | Threaded
Open this post in threaded view
|

Re: [Libreoffice-commits] Revert "sorted_vector: turn Find parameter into template"

On 08/01/2012 03:01 PM, Michael Stahl wrote:

> commit 8291d41667b1a63d35bf818aaf9d75529e1f12f0
> Author: Michael Stahl <[hidden email]>
> Date:   Wed Aug 1 14:41:43 2012 +0200
>
>      Revert "sorted_vector: turn Find parameter into template"
>
>      This reverts commit 3e3acee762fac71f7356ed1305a64e0278278081.
>
>      It was a nice idea, but C++ is not yet ready for it; with the travesty
>      of parametric polymorphism in C++ the find_unique inside the definition
>      of find_unique actually refers to find_unique<Value, Compare>, so there
>      is no way to actually refer to template<Value, Compare> find_unique
>      inside its definition.  Thanks to Luboš Luňák for explaining
>      the problem to me.  Somehow this does work in GCC 4.7 even with
>      -std=c++98, likely by accident.

The way to refer to the find_unique template from within the class
definition itself is with o3tl::find_unique.  So much for "language design."

Stephan
_______________________________________________
LibreOffice mailing list
[hidden email]
http://lists.freedesktop.org/mailman/listinfo/libreoffice
Michael Stahl-2 Michael Stahl-2
Reply | Threaded
Open this post in threaded view
|

Re: [Libreoffice-commits] Revert "sorted_vector: turn Find parameter into template"

On 02/08/12 08:17, Stephan Bergmann wrote:

> On 08/01/2012 03:01 PM, Michael Stahl wrote:
>> commit 8291d41667b1a63d35bf818aaf9d75529e1f12f0
>> Author: Michael Stahl <[hidden email]>
>> Date:   Wed Aug 1 14:41:43 2012 +0200
>>
>>      Revert "sorted_vector: turn Find parameter into template"
>>
>>      This reverts commit 3e3acee762fac71f7356ed1305a64e0278278081.
>>
>>      It was a nice idea, but C++ is not yet ready for it; with the travesty
>>      of parametric polymorphism in C++ the find_unique inside the definition
>>      of find_unique actually refers to find_unique<Value, Compare>, so there
>>      is no way to actually refer to template<Value, Compare> find_unique
>>      inside its definition.  Thanks to Luboš Luňák for explaining
>>      the problem to me.  Somehow this does work in GCC 4.7 even with
>>      -std=c++98, likely by accident.
>
> The way to refer to the find_unique template from within the class
> definition itself is with o3tl::find_unique.  So much for "language design."

thanks, that does indeed seem to work even with MSVC2008.
have un-reverted this now...


_______________________________________________
LibreOffice mailing list
[hidden email]
http://lists.freedesktop.org/mailman/listinfo/libreoffice