I was interested in the question - when is it better to use links, and when are pointers as parameters of functions for objects?
For example:
CMyData1 data1; CMyData2 data2; func_r(data1, data2); func_p(&data1, &data2); In theory, it makes absolutely no difference, it’s a bit more comfortable with the links, because you don’t have to write -> , but use the native one for objects . .
Can you say that you can use this rule:
if the function expects only existing objects to enter, then references are used, if it is assumed that the object may not exist, then pointers need to be used (so that nullptr can be passed)?