Explicitly specialize weakptr for ptrs only.

Add operator= that takes a ref instead of a ptr.

Fix typo in the XSLT template.
Detect attempts to ref/ptr(this) in constructors and destructors.

And update documentation.
Added fixed_semaphore, helper create() for semaphore's owner object.