vorner / arc-swap

Support atomic operations on Arc itself

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

const construct for ArcSwapOption

withoutboats opened this issue · comments

It would be really nice if there were a const construct for ArcSwapOption.

For the empty one? 🤔

I'll have to check that:

  • const fn is working all the way back to what the crate promises to support.
  • That the internal locking strategy is actually const-constructible.

But it might be possible

It seems to work in #63. There's just the one thing I don't like: this needs to be a separate const_empty method instead of constifying the existing empty one. I'd be happy for some suggestions if this can be alleviated, or for a quick scan of the changes before I merge and publish it.

And thanks for the suggestion, it really does seem useful :-).

Yea, there's no way to make empty work since you can't call Default::default in a const context. Thanks for your quick attention to this :)

Released as 1.4.0