ac-library-rs icon indicating copy to clipboard operation
ac-library-rs copied to clipboard

Implement `Clone` and `Debug` for `Segtree`

Open NotLeonian opened this issue 9 months ago • 2 comments

Implement the Clone and Debug traits for Segtree. Since M::S has the Clone constraint, the Clone trait can be derived.

For the Debug trait, I propose adding use std::fmt::{Debug, Error, Formatter, Write}; and defining the fmt function based on the existing implementation in LazySegtree, excluding the output for self.lz. In this approach, we should take into account that the Debug implementation for LazySegtree includes a comment saying // TODO is it useful? .

NotLeonian avatar Feb 22 '25 02:02 NotLeonian

It makes sense to align the Debug implementation for Segtree with LazySegtree #143 once the discussion is settled.

NotLeonian avatar Feb 23 '25 08:02 NotLeonian