Boost logo

Boost Users :

Subject: [Boost-users] Tag dispatching
From: Hicham Mouline (hicham_at_[hidden])
Date: 2009-03-04 07:54:50


Hello,

I have a question about tag dispatching (for e.g. the std::advance() function in the std lib, as described for instance in http://www.boost.org/community/generic_programming.html#tag_dispatching)

1. The call to
    detail::advance_dispatch(i, n, category);
I don't understand. category is a type not an object, it should be category(), right?

2. If I am correct,
the tags are empty structs which I assume allows modern compilers
(g++4, msvc8/9, intel) to optimize away the creation of that category object ?

3. If i am still correct, I have a tag which has no members except 1 static function that returns void.
Would that optimization still apply?

regards,


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