parameters for function: const reference and pointer for constant data

2

What is the difference in terms of performance (in the case of large object) the calls below:

void funcao( const tipo  &objeto )

and

void funcao( const tipo *objeto )

I know that in the first one it receives a constant reference, which is good not to need to copy the object, it only creates a nickname for the object, and since e const , the object can not be modified;

and (I know that) in the second it receives the address of the object, and since it is const , the object can not be modified.

    
asked by anonymous 09.01.2017 / 19:09

1 answer

1

In principle it makes no difference, since the obvious implementation of a parameter by reference is simply a pointer.

    
09.01.2017 / 23:08