[SUGGESTION] Question/Code Review Request: Simple implementation provider in cpp2 #625
Replies: 3 comments
-
I've heard the idea floating around of writing concrete code, So you can use concrete types with stable interfaces, |
Beta Was this translation helpful? Give feedback.
-
Thank you for the answer. That gave me some additional thinking. |
Beta Was this translation helpful? Give feedback.
-
Depends on what you mean with keeping them in sync. |
Beta Was this translation helpful? Give feedback.
-
I started to play with cpp2 recently. I think this is great improvement in abstraction definition for C++.
I'm working on a simple rendering system and I would like to have the ability to select different implementations on different platforms.
I think that
@interface
is the way to go. I wonder what is the best way to select/initialize particular implementation. I use ImplementationProvider as a single point of change.Here is a simplified example to show what I mean:
What do you think about the code?
I'm open to suggestion about different ways to implement that function too.
Beta Was this translation helpful? Give feedback.
All reactions