lmi
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[lmi] Why use pointers here? [Was: PATCH: use std::uncaught_exceptions()


From: Greg Chicares
Subject: [lmi] Why use pointers here? [Was: PATCH: use std::uncaught_exceptions()]
Date: Mon, 2 Apr 2018 13:19:49 +0000
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.6.0

On 2018-03-31 16:18, Vadim Zeitlin wrote:
> 
>  [...] please see https://github.com/vadz/lmi/pull/78
BTW, why use pointers here?

@@ -2942,16 +2929,16 @@ void ledger_pdf_generator_wx::write
     switch(z)
         {
         case mce_ill_reg:
-            pdf_ill = std::make_unique<pdf_illustration_regular>(ledger, 
output);
+            pdf_ill = std::make_unique<pdf_illustration_regular>(ledger);
             break;
...
-    pdf_ill->render_all();
+    pdf_ill->render_all(output);

AFAICT, classes like pdf_illustration_regular aren't "factories"
that only return smart pointers, so couldn't we instead write:

  pdf_illustration_regular>(ledger).render_all(output)

and similarly for the other classes?



reply via email to

[Prev in Thread] Current Thread [Next in Thread]