如何在 UML class 图中表示纯虚函数?

How do I denote a pure virtual function in a UML class diagram?

我是一名学习C++的学生。我正在为涉及继承和抽象/具体 class 的程序创建 UML class 图,但我不太确定如何表示纯虚函数。感谢任何帮助,谢谢!

UML 标准确实表明行为特征(例如 method/operation)可以设置其 属性 isAbstract 以表明它是抽象的并且没有实现。然而,没有关于如何在图中显示它的内容。

根据uml-diagrams.org and other sources, in older UML versions (1.4.x), an abstract operation was shown with a name in italic or with a textual {abstract} marker following its name. The italic convention was widely used (See also here).

当前的 UML 不再使用斜体,也没有说明如何表示 isAbstract 属性。尽管如此,{abstract} 标记应该仍然有效。