
I looked into the code and I've a question: in the shared_mutex.hpp the default-ctor of shared_mutex does initialize in
Kowalke Oliver (QD IT PA AS <Oliver.Kowalke <at> qimonda.com> writes: the ctor body instead using
the initialisation list. Could you explain me why this way was choosen? (if I can remember correctly - Scott Meyers voted for using initialisation lists over assignment in ctors).
The POSIX code is based on the win32, which does the initialization in the constructor body. There is probably not a sensible reason in this case. For win32, the semaphores are stored in an array (for use with WaitForMultipleObjects), and arrays can't be initialized in the constructor initialization list. It then made sense to initialize everything in the body, so it was done in one place. Anthony