diff --git a/ChangeLog b/ChangeLog index 22cc301d..d3d6e0ae 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,6 @@ +2018-12-19 Markus Gans + * Use of smart pointers + 2018-12-17 Markus Gans * Improve FButton mouse click animation * Minor data type corrections diff --git a/examples/calculator.cpp b/examples/calculator.cpp index d579714e..15377f98 100644 --- a/examples/calculator.cpp +++ b/examples/calculator.cpp @@ -25,6 +25,7 @@ #include #include #include +#include #include #include @@ -236,7 +237,7 @@ class Calc : public finalcut::FDialog }; std::stack bracket_stack{}; - std::map calculator_buttons{}; + std::map > calculator_buttons{}; std::map key_map{}; }; #pragma pack(pop) @@ -252,9 +253,9 @@ Calc::Calc (FWidget* parent) setGeometry (19, 6, 37, 18); addAccelerator('q'); // Press 'q' to quit - for (int key = 0; key < Calc::NUM_OF_BUTTONS; key++) + for (std::size_t key = 0; key < Calc::NUM_OF_BUTTONS; key++) { - auto btn = new Button(this); + auto btn = std::make_shared