C++ variadic templates
Introduction
C++11 variadic templates are templates accepting any number of template parameters.
C++11 variadic templates are templates accepting any number of template parameters.
Once boost::format
object has been created with a format string and given arguments, there are two ways of getting a std::string
(or std::wstring
) from it. One is with boost::str()
and the other way is with str()
member method.
Many C++ developers find themselves in a place where they need to store information in an external file, which they can retrieve later to perform the operation based on the values. For instance, they have created a video game which has a high score system, wherein top 5 highest scores need to be saved in a file, as information saved in memory in real-time gets deleted once the program is turned off, so they would pursue a fast way to store their values in the external source.
Boost Format is a very versatile and easy to use formatting library. If you’re using Boost, then there is no point in using other formatting libraries for formatting. For most uses, boost::format
and boost::wformat
are perfectly suitable.
In this article we will cover boost date and time format examples, horizontal alignment and formatting in loops. Other formatting examples: Numbers and wformat, boost String.
I’ve come around a problem when I needed to format DateMidnight date in JSP. Here I’ll explain 2 ways of doing this, where the other one applies only to joda.
The book by Robert C. Martin “Clean Code” is a really very useful material for all programmers. You can disagree with him sometimes (as I do), but it still provides some useful notes that helped me to place my programmer experience and knowledge where they belong. Here I’ll provide some key notes that I did while reading the book and that I’d like to memorize.