I read that for user-defined types, postponing the defintion of a variable until a suitable initializer is available can lead to better performance.
why?
I read that for user-defined types, postponing the defintion of a variable until a
Share
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
For user-defined types in particular, the constructor and setting method could me arbitrarily complex and time-consuming. Taking Steven’s example:
… the implementation of X::X() and X::Set() might both be very time-consuming, and that’s why you read that the latter can have better performance.