Ex W14

Final Exercise Catch Up

I am sure, you have not solved all of the exercises during the semester. Today is the final time to catch up while you have a coach available


Prepare questions you might want to ask on the lecture, so you can be well prepared for the exam. Collect your questions and answers given on this wiki page!

Try Core Guideline Checker in Cevelop 1.7.1

Cevelop already provides several checkers for the C++ Core Guidelines.

Note: Be aware that some of the checkers are not fully optimized and might run quite some time.

try_pop with optional<T>

Take your solution of BoundedQueue and implement try_pop/try_pop_for functions that return an optional<T> and take no or just the duration as parameter. return an empty optional if try_pop fails.


Write a program using the filesystem library to compute the total size of all files in a given directory recursively. If no commmand line arguments are given take the current directory. If multiple command-line arguments are given sum up each individually and also present the total. Check if the information you can obtain from your OS corresponds with the output from your program.

call it like:

   $ mydirsize


   $ mydirsize /tmp


   $ mydirsize dirA dirB

How can you write test cases for your functionality? Note: you can employ the filesystem library also in your test cases!

MinGW: If you are programming on Windows with MinGW your toolchain may be lacking the support of the filesystem library. You can use Boost filesystem as alternative. It works essentially the same.

Last edited May 31, 2017