Search code examples
c++qtreferencecoding-styleparentheses

C++ function parameter as reference


I have a question. Can anyone tell me why someone would declare parameter r like that ?

Whats the difference between Record& r and Record(&r) ?

QDataStream& operator>>(QDataStream &s, Record(&r))
{
}

Thanks :)


Solution

  • Record(&r) and Record &r are identical type declarations. I don't know why somebody would include the parentheses except for stylistic reasons. Perhaps it's some cruft left over from a refactoring?