影响其显式参数的方法是什么?
我现在正在用 C++ 记录一些代码,我打算编写的方法之一将对数组进行排序。不过,它不会创建新数组,而是对给定数组的元素进行排序。我想添加一条评论,“如果原始排序对您很重要,那么就不要使用此方法!”但我宁愿说“对给定数组进行静态排序?!...危险!...带有突变!!!”像您这样的程序员能够理解。
用什么词形容这种方法?
额外问题:谁能推荐一个 C++ 工具,可以根据特殊格式的注释创建 HTML 文档,例如 javadoc?我选择的操作系统是 Ubuntu。
编辑:我是一名学生,我的作业是排序。
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 "sorts 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.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
对给定数组进行就地排序。
您知道
std::sort
和std::stable_sort
,对吧?Sorts the given array in-place.
You are aware of
std::sort
andstd::stable_sort
, right?函数修改参数是因为它们作为非 const 引用传入,这不是很明显吗? (无耻插件:请参阅这个答案确切的参数类型表示什么。)
并且您正在寻找 doxygen。
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".