C++ Class Structural Design Questions

Asked 2 years ago, Updated 2 years ago, 115 views

Creating one library.
I'm embarrassed because I'm not used to the design pattern even though I've been doing c++ for a long time.
To illustrate the problem I've just encountered,
In this situation, the Concrete Receiver takes the data from the call of the receive function I don't know how to get a value by accessing fields that only ConcreteData has.
(So, um...) I want to get different types of values through getData)
Although it is possible by forced casting, I thought I should try to find a way as much as much as possible I have a question.

From what I read in the previous book I remember at first glance that something is possible in a way that causes polymorphism twice I forgot because I like crow meat.

Please ㅠ<

c++ design-pattern

2022-09-21 15:27

1 Answers

How about using a template?


2022-09-21 15:27

If you have any answers or tips


© 2024 OneMinuteCode. All rights reserved.