开发者

What are methods that affect their explicit parameters called?

开发者 https://www.devze.com 2023-01-18 22:08 出处:网络
I\'m documenting some code in C++ right now, and one of the methods I intend to write will sort an array. It won\'t create a new array, though, it will sort the elements of the given array in place. I

I'm documenting some code in C++ right now, and one of the methods I intend to write will sort an array. It won't create a new array, though, it will sort the elements of the given array in place. I want to include a remark along the lines of, "if the original ordering was important to you, then don't use this method!" But I would rather say something like "so开发者_如何学运维rts the given array... statically?!... dangerously!... with mutations!!!" that programmers like you would be able understand.

What word describes this sort of method?

Bonus question: can anyone recommend a tool for C++ that creates HTML documentation from specially formatted comments, like javadoc? My operating system of choice is Ubuntu.

Edit: I'm a student and my assignment is to sort.


Sorts the given array in-place.

You are aware of std::sort and std::stable_sort, right?


Isn't it obvious that a function modifies parameters because they are passed in as non-const references? (Shameless plug: see this answer for what the exact parameter type signifies.)

And you're looking for doxygen.


You already said it: the correct term is "mutator".

0

精彩评论

暂无评论...
验证码 换一张
取 消