🔧 Phase A: Add share_box() method to NyashBox trait and all Box implementations
Co-authored-by: moe-charm <217100418+moe-charm@users.noreply.github.com>
This commit is contained in:
@ -269,10 +269,17 @@ impl NyashBox for MapBox {
|
||||
StringBox::new(&format!("MapBox(size={})", size))
|
||||
}
|
||||
|
||||
|
||||
fn clone_box(&self) -> Box<dyn NyashBox> {
|
||||
Box::new(self.clone())
|
||||
}
|
||||
|
||||
/// 仮実装: clone_boxと同じ(後で修正)
|
||||
fn share_box(&self) -> Box<dyn NyashBox> {
|
||||
self.clone_box()
|
||||
}
|
||||
}
|
||||
|
||||
fn equals(&self, other: &dyn NyashBox) -> BoolBox {
|
||||
if let Some(other_map) = other.as_any().downcast_ref::<MapBox>() {
|
||||
// 同じインスタンスかチェック(データの共有を考慮)
|
||||
|
||||
Reference in New Issue
Block a user