Postblit

This lesson explains the concept of "postblit".

We'll cover the following...

What is “postblit”?

Copying is constructing a new object from an existing one. Copying involves two steps:

  1. Copying the members of the existing object to the new object bit-by-bit. This step is called blit, short for block transfer.
  2. The second step is making further adjustments to the new object after the block transfer. This step is called postblit.

The first step is handled automatically by the compiler, which copies the members of the existing object to the members of the new object:

auto returnTripDuration = tripDuration; // copying

Do not confuse ...