我正在类构造函数中调用operator ++(),建议使用operator ++();而不是++(* this)。两者有什么区别?
基本上没有区别。 ++(*this)被重写为operator++()的调用。
++(*this)
operator++()
在晦涩的情况下,过载的解决方案可能会有所不同,但是您可能想要避免仍然会发生这种情况。
我会使用++(*this)。