In C++, overload
and override
are not related, but they are easily confused due to the similarity of the terms.
Samba Configuration on Linux
Through Samba, we can mount folders from Linux to Windows. After deploying Samba on a Linux virtual machine, I can use the remote compilation plugin I wrote a few days ago (sublimeRemoteCompile) to write code on Windows! It’s quite enjoyable. Today, I will briefly record how to configure Samba sharing on the server for friends with similar needs.
Knowledge collection of tools and development environments
Some tips on tools and environment configuration or related knowledge concepts are recorded here.
Remote compilation plugin for SublimeText
Running some small test codes on Linux from Windows can be quite tedious, especially since I have to manually execute the compilation commands on Linux. Also, using Samba on my Raspberry Pi to share the code to Windows requires me to SSH and compile it manually, which is a waste of time.
These past few days, I wrote a small Sublime Text plugin during my free time to remotely compile C/C++ code on Windows, meaning that I write the code on Windows but it actually executes on Linux. I’ve only implemented the functionality for now, and I plan to optimize it during my break after the holidays.
The code is hosted on GitHub: sublimeRemoteCompile, using some C++11
features, and the compiler must be specified during compilation.
The logic behind array subscript access
For arrays, subscript operations are a way of random reading and writing, and they are also the most common method. However, many textbooks (especially domestic ones) state that the array name is a pointer, which is incorrect. Moreover, there are a set of rules behind array subscript access; familiarizing yourself with these rules can help analyze the actual meaning of the code in some complex semantic situations.
Wrap an override member function pointer
Using variable-length parameter templates and lambda (or using generic lambda) to wrap overloaded member function pointers for convenient usage (like bind binding or other places that require overloaded member function pointers). For more introduction on member function pointers, please see my other article: Pointers to Class Members in C++ Are Not Pointers.
The C++ Object and Memory Model
More documentation:Memory Model and Default Constructor Construction.
Some thoughts on reading
How to delineate the most important 20% in an unfamiliar field or book? How to identify trivial details?
I hadn’t deeply contemplated these methodologies in my previous reading and studying, thinking they were merely empty talks. However, I now feel that mastering a suitable technique is like having a sharp blade in hand, allowing one to navigate obstacles with ease.
Reading TC++PL/C++Primer/ISO C++
Spent a month reading TC++PL4E. Since I had previously read C++ Primer and understood most of the C++ syntax, the reading speed was quite fast. However, by reading alongside the C++ standard, I discovered many things in C++ that I previously didn’t know. From the perspective of the standard and the father of C++, C++ is indeed comprehensive enough. Thus, I’ll compare C++ Primer, TC++PL4E, and the ISO C++ documentation.
What is POD in C++?
POD is Plain Old Data. In C++, it refers to objects that can be treated as “data only,” where programmers do not need to worry about the complexity of class layout, as well as user-defined constructors, copy, and move semantics.