patterns icon indicating copy to clipboard operation
patterns copied to clipboard

Rephrase statement in Deref: "Collections are smart pointers"

Open StrayLittlePunk opened this issue 4 years ago • 4 comments

Disadvantages Methods and traits only available via dereferencing are not taken into account when bounds checking, so generic programming with data structures using this pattern can get complex (see the Borrow and AsRef traits, etc.). why method and traits only available via dereferencing are not taken into account when bounds checking ?

StrayLittlePunk avatar Apr 21 '21 02:04 StrayLittlePunk

I agree it's really complicated. If someone wants to improve this a PR is welcome.

marcoieni avatar Apr 21 '21 05:04 marcoieni

I don't understand that sentence itself. I thought bound checks are usually eliminated when using collections and iterator method?

pickfire avatar Apr 21 '21 12:04 pickfire

@pickfire I don't think so, it said method and trait are not taken into account. the statement link at below Original Statement link

StrayLittlePunk avatar Apr 25 '21 09:04 StrayLittlePunk

@MarcoIeni I think so too

StrayLittlePunk avatar Apr 25 '21 09:04 StrayLittlePunk