Class template argument deduction is a useful feature in C++17 that helps developers to simplify the code by avoiding writing the template argument list when initializing objects of class templates (or when performing function-style casts). The compiler provides an implicit set of deduction guides, which are fictional function templates for a hypothetical class and uses them to perform template argument deduction and overload resolution. However, you can extend this set of deduction guides with your own, and in some cases, such as for aggregate types, you need to do so.
Here is my list of good reads from August:
A CRON expression is a string composed of six fields (in some implementation seven), separated by a whites space, representing a time schedule. CRON expressions are used in various job schedulers (such as the Linux job scheduler, the Quartz scheduler, Azure scheduler for functions, etc.). Recently, I have written a C++ library for parsing such expressions and determining the next occurrence of the scheduled time. The library is called croncpp. It is written in C++17, is header-only, open-source and cross-platform, and can be found on GitHub.
A couple of weeks ago, version 15.8 of Visual Studio 2017 was finally released. You can read here about the new things available in this version. In this post, I will discuss five productivity features available for C++ development.
Here is my list of good reads from July:
C++ has several special member functions that are defined by the compiler even if not defined by the user. These special member functions are the default constructor, the copy constructor, the copy assignment operator, the move constructor, the move assignment operator, and the destructor. However, there are many rules for what is defined and in which circumstances. For instance, if no special member function is defined by the user then all of them are implicitly defined by the compiler. On the other hand, if a copy constructor or copy assignment operator is defined by the user, then the move constructor and move assignment operator are not defined by the compiler. To make it easier to comprehend all the rules, the following table describes what is defined by the compiler based on what is defined by the user.
Partial function application is the process of taking a function with a number of arguments, fixing (or binding) some of its arguments and producing a new function with a smaller number of arguments. In C++, this can be achieved with std::bind() that generates a forwarding call wrapper for a callable object, and the placeholder objects from the std::placeholders namespace that are used for binding arguments to the callable object.
In my previous article, C++17 removed and deprecated features, I presented a list of the most important features that were either removed or deprecated in C++17. When you’re using deprecated features, compilers warn you about that. In this article, I will show how you can silence these warnings when using Visual Studio 2017.
Along with the new features added to the language and the standard library in C++17, there are also existing features that have been either removed (after being deprecated in a previous version) or deprecated so they would be removed sometime in the future. Although not complete, the following tables list the most important of these removed or deprecated features.
Here is my list of good reads from June: