Can someone give me an example of the Decorator design pattern in C++ ?
I have come across the Java version of it, but found it difficult to understand the C++ version of it (from the examples I found).
Thanks.
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
Vince Huston Design Patterns, even though its layout is poor, has C++ implementation for most design patterns in the Gang of Four book.
Click for Decorator.
There isn’t much difference with Java, except the manual memory handling that you’d better wrap with smart pointers 🙂