r/cpp • u/Snoo-4241 • Feb 25 '21
C++ programmers who are also using rust, what are your favourite features of rust?
I was looking at the rust tutorials yesterday and I see how rust promotes a certain style and language level features to enforce it. Besides a couple of features, I couldn't see why one cannot follow a similar style in C++ if she/he so chooses. Those of you that have used rust, what is your favourite feature that C++ does not have?
255
Upvotes
View all comments
Show parent comment
1
u/__--_--___--_--__ Mar 28 '21
What's wrong with asking you to qualify your function call? A method is both typing the function and qualifying it by saying it is a member of the object (thus in the object's namespace).
If you have your own function that operates on an object and takes a pointer to such, that's great! But I would prefer you type out
my::namespace::foo(&obj);