& pointer operator help

So heres this line I have:

 
try {  warpPerspective(*((oclMat*) src),*((oclMat*) dst),*((Mat*)M),*((Size*) dsize), flags, borderMode,(Scalar&) borderValue);} 


What does the Scalar& mean? I know if & comes before, it means its "the adress of". Here its used after a type in a casting operation, does the & mean anything or should i take it to be just part of the Scalar name? (doesnt sound likely :/)

Thanks in advance
Last edited on
I went over this but for what I understood a reference starts with a &, doesn't end with it. So this looks more like a casting operation on borderValue to the Scalar& type, not a creation of a reference value. So I'm still not sure what the & does to Scalar..
reference starts with a &, doesn't end with it
No. Reference come after type:
1
2
int x;
int & y = x; //y refers to x 


this looks more like a casting operation on borderValue to the Scalar& type
Correct. Scalar& names type reference to Scalar. I do not know why they used unsafe C-cast, but your code will be valid only if borderValue has type of Scalar, or derived from it.
thanks again miinipaa
Topic archived. No new replies allowed.