commentA further suggestion to "An alternative approach": Since
Since the destructor also adds a new line to the screen, if you call two progress bars in the same function they will appear in the reverse order on your screen
for example;For example:
Will returnThat will display: Progress bar 2 ............................................ [100%] Progress bar 1 ............................................ [100%]
Progress bar 2 ............................................ [100%]
Progress bar 1 ............................................ [100%]
because of the order the stack islocal objects are deleted.
Will returnThis will display: Progress bar 1 ............................................ [100%] Progress bar 2 ............................................ [100%]
Progress bar 1 ............................................ [100%]
Progress bar 2 ............................................ [100%]