1) Are you doing this to involve the constructors of the int data member value?
2) Why would you do this instead of just doing this->value = value; once inside the entry Constructor,
3) What is a Entry() = default?
Answers:
1) Intrinsic types like int, float, char don't have constructors, so the short answer is no.
2) The reason to use this method of initialization is optimization really. When your object "Entity" is created, there are two things that happen. First memory is allocated to the size of all data members listed in the class. If your class has two ints, the your class is allocated 8 bytes ( int is 4 bytes 2 * 4 = 8 ). Second, the constructor is called to initialize those members. The reason to use the class initializer list is to have the data members initialized at the same time as the object allocation. If you use the constructor body, you are assigning values after the members of the object have been initialized, which means that the members first get allocated, then initialized then assigned new values. If you use the initializer list as chili did in the video, your members get allocated and initialized and that's it. So you save a step.
3) Basically it means to use a compiler generated default for the constructor. Other functions you can meaningfully use = default on is the copy and move constructors, the copy and move assignment operators and the destructor.
Entity() = default; // Default constructor
Entity( const Entity& ) = default; // Copy constructor
Entity( Entity&& ) = default; // Move constructor
Entity& operator=( const Entity& ) = default; // Copy assignment operator
Entity& operator=( Entity&& ) = default; // Move assignment operator
~Entity() = default; // Destructor
You'll learn about inheritance later, but for completeness sake:
virtual ~Entity() = default; // Base class virtual destructor
Most of the time, you don't have to even bother with declaring the copy/move constructors or assignment operators nor the destructor. Again, chili covers this stuff in his vids. If you have a unmovable object in your class, then the compiler won't create one for you, so you have to create one. If you have a pointer in your object and you plan on copying from A to B then you probably want to copy the data that the pointer points to so you need to create a copy constructor and copy assignment operator so the data on the heap the pointer points to gets copied, which you must do manually.
You can prevent things from being copied by changing = default to = delete next to the copy constructor and copy assignment operator.
Chili introduces constructors:
Beginner tutorial 12.
Chili covers the rest of what I put here in
Intermediate tutorial 6.
Sorry, didn't realize that shit was discussed after intermediate tutorial 4.
If you think paging some data from disk into RAM is slow, try paging it into a simian cerebrum over a pair of optical nerves. - gameprogrammingpatterns.com