Boost logo

Boost :

From: Anthony Williams (anthony_w.geo_at_[hidden])
Date: 2008-01-25 10:58:04


Kowalke Oliver (QD IT PA AS <Oliver.Kowalke <at> qimonda.com> writes:

> I looked into the code and I've a question:
> in the shared_mutex.hpp the default-ctor of shared_mutex does initialize in
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


Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk