And that is true of course. To go beyond that we have structures and classes which have explicit construction and operators. However, C++ has inherited C strings which are just a pointer to the first char, but they also have a long history where the construction and operations are well known. So, when a C String is given to a map or vector, it may be thought that it could be doing a deep copy. After all, it is known (by implicit rules) how this could be completed. The size is defined. It is just not stored. Also, the storage is clear – just not managed.
So you have an old Microsoft Wireless Desktop 3000 Keyboard and Mouse. You get used to it and it becomes your ‘personal standard’ for keyboards. It has full travel keypress and all the keys laid out the way you want them – the large Enter Key and the Media Mute key. But then it gets old and breaks and they don’t make that version anymore, so you look for the closest replacement. In this case the cheaper Microsoft Wireless Keyboard 2000. It’s OK and you put up with it, but the mouse starts to break as well. What to do…
This started out as a task to learn simple class inheritance. To work out the syntax and idiomatic way to use them in C++. I just kept typing things that I thought would work and the compiler would slowly teach me what was wrong.
class rectangle : public shape
rectangle(float half) : shape(half)
This is a series of things that I found out when learning C++. The approach is going to be non-standard and likely to annoy any normal C++ professional. I am interested in languages in general and so I will be doing all my early code without STL at all. I want to learn what features the language offers before starting to use the standard libraries. To this end I try to do do simple version of the features that are already available. That way I can see how these features are implemented in the standard libraries. To me, that feels like a important advantage in learning a language. I did try to read the code for the libraries but it has a lot of very nuanced additions that I will only get to understand much later on. The code is still interesting to step through however as it does offer clues as to how to unpick various implementations.