digitalmars.D.announce - Blog Post #0105: D-specific Stuff for GUI Programming
- Ron Tarrant (4/4) Mar 23 2020 Today starts a new series I'm calling Snippets and it's about
- drug (3/7) Mar 23 2020 Thank you for you efforts!
- Jacob Carlborg (13/17) Mar 23 2020 If it's enough with CTFE compatible code in the constructor, the
- Jacob Carlborg (9/19) Mar 23 2020 Or if an immutable instance work, the getter is not necessary and
- Jacob Carlborg (8/12) Mar 23 2020 Should of course be `static`:
- Ron Tarrant (4/16) Mar 23 2020 Cool. Thanks, Jacob.
Today starts a new series I'm calling Snippets and it's about various D-specific stuff that may come in handy when building a GUI. You can find it right here: https://gtkdcoding.com/2020/03/23/0105-dlang-ui-snippets-i.html
Mar 23 2020
On 3/23/20 1:02 PM, Ron Tarrant wrote:Today starts a new series I'm calling Snippets and it's about various D-specific stuff that may come in handy when building a GUI. You can find it right here: https://gtkdcoding.com/2020/03/23/0105-dlang-ui-snippets-i.htmlThank you for you efforts! I'm waiting for your post about Observer.
Mar 23 2020
On Monday, 23 March 2020 at 10:02:48 UTC, Ron Tarrant wrote:Today starts a new series I'm calling Snippets and it's about various D-specific stuff that may come in handy when building a GUI. You can find it right here: https://gtkdcoding.com/2020/03/23/0105-dlang-ui-snippets-i.htmlIf it's enough with CTFE compatible code in the constructor, the following is a much simpler version: class DSingleton { private __gshared DSingleton instance = new DSingleton; DSingleton get() { return instance; } } -- /Jacob Carlborg
Mar 23 2020
On Monday, 23 March 2020 at 10:26:33 UTC, Jacob Carlborg wrote:If it's enough with CTFE compatible code in the constructor, the following is a much simpler version: class DSingleton { private __gshared DSingleton instance = new DSingleton; DSingleton get() { return instance; } }Or if an immutable instance work, the getter is not necessary and the instance can be exposed directly. class DSingleton { immutable DSingleton instance = new DSingleton; } -- /Jacob Carlborg
Mar 23 2020
On Monday, 23 March 2020 at 10:41:43 UTC, Jacob Carlborg wrote:class DSingleton { immutable DSingleton instance = new DSingleton; }Should of course be `static`: class DSingleton { static immutable DSingleton instance = new DSingleton; } -- /Jacob Carlborg
Mar 23 2020
On Monday, 23 March 2020 at 10:45:24 UTC, Jacob Carlborg wrote:On Monday, 23 March 2020 at 10:41:43 UTC, Jacob Carlborg wrote:Cool. Thanks, Jacob. I can't take credit for the Singleton code, though. I stole it from here: https://wiki.dlang.org/Low-Lock_Singleton_Patternclass DSingleton { immutable DSingleton instance = new DSingleton; }Should of course be `static`: class DSingleton { static immutable DSingleton instance = new DSingleton; } -- /Jacob Carlborg
Mar 23 2020