OutputParams refactoring
Jean-Marc Lasgouttes
lasgouttes at lyx.org
Sat Nov 7 00:39:25 UTC 2020
Le 06/11/2020 à 23:53, Yuriy Skalko a écrit :
> Yes, RefChanger is an interesting approach, it will be better than stack.
>
> This NewOutputParams class looks like variation of the RefChanger. Right?
>
>
> I understand how RefChanger works, but Changer is a strange thing. How
> can it work with empty functions? And why Revertible definition is
> called forward declaration? Am I miss something?
>
>> // Forward declaration for support/RefChanger.h
>> struct Revertible {
>> virtual ~Revertible() {}
>> virtual void revert() {}
>> virtual void keep() {}
>> };
>> using Changer = unique_ptr<Revertible>;
I never understood how it works, but I always assumed it was C++ for
grown ups, jut without the lambda function mess. All I can say is that
it works :)
JMarc
More information about the lyx-devel
mailing list