fleece
fleece copied to clipboard
Improvements to Ref<>
destroy()method releases the reference, equivalent to= nullptrwhich is otherwise disallowed. This is for cases where a non-null reference needs to be released in e.g. aclose()method, but it's understood that it can't be accessed again. This allows it to be typed asRef<>.isValid()returns false if the Ref has been destroyed.operator boolis disallowed for Ref<>, because it's conceptually not nullable, so testing it is usually a sign that you're doing unnecessary checks. If you really need to check, use isValid().
Also converted some Retaineds into Refs in the Fleece codebase, and fixed a template method in ValueSlot that didn't work with Ref.
Also fixed some new clang printf warnings.