Why would the implicitly generated constructor (et al.) be more efficient than a user-defined (trivial) one?

前端 未结 4 1229
梦毁少年i
梦毁少年i 2020-12-20 13:04

I read this article from D. Kalev this morning about the new c++11 feature \"defaulted and deleted functions\", and can\'t understand the part about performance, namely:

4条回答
  •  感情败类
    2020-12-20 14:00

    Take performance claims "with a grain of salt".

    I've heard a high-rated MIT professor make a claim like that for his favorite thing, and the only reason nobody asked him "why" was because he was a high-rated MIT professor.

    Such constructors and destructors might have other advantages, but claims about performance (outside of big-O) are seldom even meaningful except in highly contrived circumstances.

提交回复
热议问题