Using `Twine` to construct a `SmallString`?

Why llvm::SmallString doesn’t have a constructor which takes Twine? And is it idiomatic to do something like this?

There’s Twine::toVector(SmallVectorImpl<char> &) for this.

Thanks for the heads up, but this requires me to have the SmallString object in advance. I also could use Twine::str member function to pass it to the SmallString constructor, but it seems to negate the benefit of stack-allocated object. I understand that there no other means in the API, however I a little struggle to comprehend why such a constructor doesn’t exist for SmallString is there any specific reason for that?

As SmallString isn’t a concrete class, but a template instead. SmallString takes an ‘inline’ size as its template parameter. If Twine has a method to convert it self to a SmallString, then which SmallString it should use? SmallString<0> or SmallString<4> or something else?

Having a SmallString object in advance doesn’t negate the benefit of stack-allocated object IMO.