cplusplus
.com
TUTORIALS
REFERENCE
ARTICLES
FORUM
C++
Tutorials
Reference
Articles
Forum
Forum
Beginners
Windows Programming
UNIX/Linux Programming
General C++ Programming
Lounge
Jobs
Forum
General C++ Programming
Code to Design Pattern
Code to Design Pattern
Nov 16, 2016 at 12:56pm UTC
Monica Oleastro
(1)
Hi, I'm studying C++ programming and I was wondering if anyone has any tips on how to figure out what design pattern C++ code is following just by reading the code. Any suggestions? Thank you.
Nov 16, 2016 at 2:35pm UTC
JLBorges
(13770)
More often than not, the names of entities involved (classes, template/function parameters) are giveaways.
class Unix
Builder
: public
Builder
{ ...
https://sourcemaking.com/design_patterns/builder/cpp/1
public class Image
Proxy
implements Image { ...
http://www.oodesign.com/proxy-pattern.html
template <class
Visitor
, class... Variants>
constexpr /*see below*/
visit
(
Visitor
&& vis, Variants&&... vars);
http://en.cppreference.com/w/cpp/utility/variant/visit
Topic archived. No new replies allowed.