In Rust, we can simply implement the Deref trait on a type and have that type behave according to the deref method's definition, when being dereferenced.
I wonder, is there any other language having such a capability?
also, when using the method call syntax, C++ arrow (->) operator is automatically chased until a real pointer type is reached, (similar to but not the same as auto deref coercion in rust), which is the mechanism supporting C++ smart pointers.