When you access an element outside a container of the STL, the result is not so promising. You effect may be an error or undefined behaviour. Undefined behaviour means all bets are open.
Modern C++ has eight associative containers, but your special friends should be std::map and std::unordered_map. Why? Let me explain it in this post.
In 99 % of your use-cases for a sequential container, you are totally fine with a std::array or a std::vector. What? If you don't believe me, read this post.
The rules to the C++ standard library are mainly about containers, strings, and iostreams.
Today, I complete the rules of the C++ core guidelines to source files. They are about header files and namespaces.
The organisation of source files is a topic which is quite seldom addressed in C++. With C++20 we will get modules, but until then we should distinguish between the implementation and the interface of our code.
Due to the same history of C and C++, both languages are closely related. Because neither of them is a subset of the other, you have to know a few rules to mix them.
I assume you saw the additional keywords typename or template used before a name in a template. Me too. Honestly, I was quite surprised. Today's post is about dependent names and various template parameters.
I often teach the basics to templates. Templates are special. Therefore, I encounter many misconceptions which cause surprises. Here are a few of them.
Today, I finish the C++ core guidelines rules to templates with a big surprise for many C++ developers. I write about the specialisation of function templates.
Currently are 153 guests and no members online
Kubik-Rubik Joomla! Extensions