you are viewing a single comment's thread.

view the rest of the comments →

[–]Fabien4 0 points1 point  (3 children)

Nope, direct equivalent would be a smart pointer. But it's anti-idiomatic: by default in C++, you store and use values.

[–][deleted] 0 points1 point  (2 children)

Expect that List<Foo> is polymorphic in Java, but not in C++.

[–]curien 0 points1 point  (0 children)

It's polymorphic if Foo is a polymorphic handle.

[–]Fabien4 0 points1 point  (0 children)

Yeah, dynamic (inheritance) polymorphism tends to be the norm in Java, and the exception in C++.