Skip to content

Codechange: replace SINGLETON macros with template classes#64

Merged
PeterN merged 1 commit intoOpenTTD:masterfrom
PeterN:de-macro-singletons
Mar 11, 2026
Merged

Codechange: replace SINGLETON macros with template classes#64
PeterN merged 1 commit intoOpenTTD:masterfrom
PeterN:de-macro-singletons

Conversation

@PeterN
Copy link
Member

@PeterN PeterN commented Mar 10, 2026

Singleton (and static) classes are implemented via macros.

Use template classes instead, to improve code clarity.

@PeterN PeterN force-pushed the de-macro-singletons branch from d557c8a to c918709 Compare March 10, 2026 21:38
Copy link
Contributor

@rubidium42 rubidium42 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Using default constructors and destructors might be better. Not quite sure whether it'll compile though.

@PeterN PeterN force-pushed the de-macro-singletons branch from c918709 to 6b02adb Compare March 11, 2026 21:08
@PeterN PeterN merged commit 78edf59 into OpenTTD:master Mar 11, 2026
6 checks passed
@PeterN PeterN deleted the de-macro-singletons branch March 11, 2026 21:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants