This implementation has horrible and unmarked mutability problems, which really should (and can) be avoided. I think it's also leaking some memory unnecessarily. The underlying approach is sound though.<p>The `str{}` can be avoided by adding a second template argument and SFINAE'ing that it can be converted to the first one. Or just overloading as for integers.<p>Some microoptimizations jumped out but those are premature.