Chapter 7 : Class Template Instantiation

In this chapter, we will learn various aspects of class template instantiation. Understanding the class template instantiation is pivotal to the overall understanding of the functioning of templates in general. The fundamental concept of template instantiation remains the same for both function templates and class templates. However, instantiation of class template instantiation is more complex than function template.

Chapter 6 : Working with Class Templates

In the first section of the book, we have learned about the basic syntax and usage of a function template. In this second part of the book, we will focus on the class templates. Class templates are an essential tool for the programmer to design classes that can work on the generic data type. While class templates are an excellent tool for the programmers, it is slightly complex than the function templates. The syntax and usage may look a bit daunting for new programmers. In this chapter, we will learn about how to declare and define classes with templated parameters step by step with simple examples at each step.

Chapter 4 : Return type of template function in C++

This chapter will discuss the various ways we can declare or deduce the return type of a template function. We can use either template or non-template parameters to declare the return type of a function template. We can also deduce the return type using keywords like auto and decltype. In some cases, we can declare a separate type parameter for the return type. Because of these intricacies, it is necessary to discuss the template function’s return type in detail with specific examples tailored for each case.

Chapter 1 : Introduction to Templates in C++

C++ templates are intimidating for any beginner or intermediate level programmer as it is syntactically a bit cryptic and complex. Also, there are intricacies in how to use the powerful features of the language. A standard C++ book does not always go into the feature’s details instead of just touching upon the subject, which is not sufficiently explanatory for the first-time learners. Sometimes the examples are too complicated, or the explanations are too vague to understand. Often, there are not many different sample codes to practice enough to have a good grip on the subject. In other cases, the available books go so deep into the nitty-gritty of the language that the reader feels a bit lost in the sea of information. In either way, the subject seems daunting for the newbies or intermediate-level programmers. However, if we explain it systematically with simple examples and easy-to-understand explanations, the C++ template could be a powerful tool for programmers. Proper use of templates can lead to clean, elegant, and efficient code on many occasions. The reader should be a beginner or intermediate-level programmer who has a basic understanding of C++ programming. They do not need to have detailed, in-depth knowledge or vast experience on the subject but should be familiar with the C++ programming paradigm’s basic concepts and be looking to take it to the next level.

How to take snapshot and restore a snapshot in VirtualBox 5.2.6

Sometimes you may want to take a snapshot of the current state of your virtual machine (in my case Ubuntu Linux) so that you can revert back to it if anything goes wrong in the virtual machine. The feature in VirtualBox which helps in this is called a snapshot. A snapshot is basically a backup of your virtual machine in its current state.

What is memory leak in a C program?

Memory leak is a phenomenon where a running C/C++ program or a running process or thread dynamically allocates memory block from the heap but fails to free the memory block when it no more requires the memory. This happens due to programmatic error where the handle to the allocated memory block gets lost. Over a time if the same programmatic entity (a process, or a thread or a function) comes into action repeatedly and leaks memory, all the free memory of the systems goes away and eventually the systems throws the dreaded "Out Of Memory" and crumbles down.

Marketing Management Assignment – Feasibility Analysis: Launching a branch of a company in a new market/country/economic zone

In your role as a Marketing Consultant, you have been asked by Wiggo*: a fictitious European supermarket (food retailer) chain (similar to Aldi and Lidl) to research and report on the feasibility of them launching in a new international market (this can be a country or economic zone of your choice and/or one you are familiar with).