Re: & before a function
From: David White (no_at_email.provided)
Date: 03/30/05
- Next message: Mohd Hanafiah Abdullah: "Re: Translate C++ to C"
- Previous message: Tim Love: "Re: & before a function"
- In reply to: Jianli Shen: "& before a function"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Date: Wed, 30 Mar 2005 16:35:55 +1000
"Jianli Shen" <jianli@cc.gatech.edu> wrote in message
news:d2dbm5$pd9$1@news-int2.gatech.edu...
> Bitvector& ClassName::functionName(Basicblock* bb)
>
> what's the & means here,
> is that return a pointer to a Bitvector variable for future use.
No, it returns a _reference_ to a Bitvector for future use. The & as part of
a type declaration is unrelated to the & operation that takes the address of
an object. You can always tell what & means from the context (ignoring
operator overloads). In a type declaration it's always a reference, and in
an expression it's either the unary address-of operation or the binary
bitwise AND operation.
DW
- Next message: Mohd Hanafiah Abdullah: "Re: Translate C++ to C"
- Previous message: Tim Love: "Re: & before a function"
- In reply to: Jianli Shen: "& before a function"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Relevant Pages
|