
On Thu, May 12, 2011 at 11:16 AM, lcaminiti <lorcaminiti@gmail.com> wrote:
Jeffrey Lee Hellrung, Jr.-2 wrote:
[...]
I would infer from this and the documentation that
const bind(const int&) factor // outer const superfluous??? bind(const int&) factor const bind(const int)& factor // outer const superfluous??? bind(const int)& factor const bind(int)& factor bind(const int&) const factor // outer const superfluous??? bind(int) const & factor
are all equivalent, but I'm not sure. Can you please clarify in the documentation?
[...snip rest of example...]
Yes, the Tutorial section already mentions that: 1) const must always appear before bind when constant binding is used so bind ... const is not valid (this is just for simplicity, the macros could be programmed to accepts both const bind and bind const). 2) when const bind is used on a variable that is already const the bind's const has no effect.
So that addresses the placement of const; the '&' can also either be put inside or outside the bind(...), right? Also, what about commas from template instantiations? E.g., does bind(tmpl<T1,T2>) x work? - Jeff