doc: forward-port the conditions tutorial + fixup libstd example