Decorator pattern in C++

前端 未结 3 1431
情歌与酒
情歌与酒 2020-12-03 11:54

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 i

3条回答
  •  既然无缘
    2020-12-03 12:17

    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 :)

提交回复
热议问题