C++ PATTERNS

Construct Variadic, Flexible and Scalable Interface for C++ Container

Packing and perfect forwarding for variadic arguments

Pavlo Horbonos
The Startup
Published in
4 min readFeb 21, 2020

--

Welcome to the third issue of practical C++ solutions. Previous two articles (the first and the second) were dedicated to container development. Well, we won’t stop and will continue to work with them. Though there are more things to talk about, for example, about interfaces and encapsulation. So, let’s unite these great topics.

Yes, people have been discussing one of the OOP pillars for a long time. And I won’t repeat all of those talks, as I believe you are already familiar with encapsulation. Instead, I want to focus on practical designs and applications. In our case, it is engineering the container’s interface.

Let’s imagine a simple container for complex values storage. It should provide preprocessing of the new element and create the content based on the additional arguments. For example:

--

--

Pavlo Horbonos
The Startup

Art & Code | https://twitter.com/MidvelCorp 💻| Head of Blockchain Security in https://blaize.tech/ | web3 and blockchain enthusiast and researcher