Boost logo

Boost Users :

From: David Abrahams (dave_at_[hidden])
Date: 2005-10-06 08:42:16


Geoffrey Romer <geoff.romer_at_[hidden]> writes:

>> > If so, doesn't that mean Cromwell's fix is incorrect?
>>
>> I'm afraid I've not seen his fix.
>
> It was given in the grandparent of your first mail in this
> thread. If you like I can forward it to you privately, I'd prefer
> not to clutter the list by re-sending it.

I'm also afraid I don't have time to look at it right now.

>> > I'm feeling generally very confused about the circumstances in
>> > which one does and does not use the typename...::type syntax.
>>
>> C++ Template Metaprogramming has a whole appendix dedicated to that
>> question, which some have told me is the clearest explanation
>> they've seen.
>
> Assuming you're referring to Appendix B, I've read it, but I don't
> think it addresses my confusion. That appendix addresses the issue
> of when the C++ language requires one to use the typename and
> template keywords. I think I understand that. What I don't
> understand is when I should be saying "typename
> metafunc<args>::type" and when I should be using plain
> "metafunc<args>". This isn't a language-correctness issue, it's an
> MPL usage issue.

Oh. Maybe mapping into the runtime world will help. If you think of
metafunc as a regular function, then "metafunc<args...>::type" is
equivalent to a regular function call, and "metafunc<args...>" is
equivalent to boost::bind(func, args...)

These are exact analogies, AFAICT.

-- 
Dave Abrahams
Boost Consulting
www.boost-consulting.com

Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net