Functional in TR1 and C++11
This post continues our journey through the functional features of classical, modern, and future C++. Today, we stop in the present.
This author has not written his bio yet.
But we are proud to say that Rainer Grimm contributed 689 entries already.
This post continues our journey through the functional features of classical, modern, and future C++. Today, we stop in the present.
C++ is not a functional programming language, but you can program in a functional style. What are the functional features of C++? I will answer this question for C++98.
C++ is not a functional programming language. C++ has its roots in procedural and object-oriented programming. So it’s pretty surprising that programming in a functional style becomes increasingly important in C++. That is not only true for C++. That also holds for Python, which has many functional features, and even for Java. Now Java has […]
After I have written a few posts about memory management in C++, I’m very glad to present Jonathan Müller, which will write a guest post about his implementation of the memory library. He will explain to us his concepts about his design. Jonathan is known as an expert in memory management in the C++ community. […]
In C++ you have the choice between various memory allocation strategies. In addition to the frequently used dynamic memory allocation, you have the stack allocation. But you can preallocate the memory at the start time of your program. This can be a fixed-sized block or one or more memory pools. Each of these strategies has […]
There are a lot of different strategies for allocating memory. Programming languages like Python or Java request their memory from the heap at runtime. Of course, C or C++ also has a heap but prefers the stack. But these are by far not so only strategies for allocating memory. You can preallocate memory at the […]
In my post Time for Wishes, I asked: “How can I improved my blog?” And here are the answers.
What is common between all containers of the Standard Template Library? They have a type parameter Allocator that is by default std::allocator. The job of the allocator is to manage the lifetime of its elements. That means allocating and deallocating memory for its elements and initializing and destroying them.
I overloaded in the last post operator new and delete. Therefore, finding memory leaks and getting the first hint of the bad guys. My solution had two not-so-nice properties. With this post, I will overcome them.
It happens quite too often that a C++ application allocates memory but doesn’t deallocate it. This is the job of the operator to new and delete. Thanks to them both, you can explicitly manage the memory management of an application.