Boost logo

Boost :

From: Rob Stewart (stewart_at_[hidden])
Date: 2005-02-14 16:12:19


From: christopher diggins <cdiggins_at_[hidden]>
> From: "Preston A. Elder" <prez_at_[hidden]>
>
> > First, that the policy stuff is all static. This makes it impossible for
> > me to have two or more individual profilers going, using the same policy,
> > but, say, a different output file, without making the policy extremely
> > complex and doing all kinds of string matching to sort out whats what.
>
> How would you propose doing it differently?

I think he is referring to the approach of deriving from the
policies such that they can have non-static data members. This
also means that you would typically call the policy member
functions without qualifying them with the policy class name.

Note that deriving from the policies introduces the whole issue
of MI versus chaining. The former has size and performance
implications. The latter imposes structure on the policy
classes:

template <typename Base>
struct policy1 : Base
{
};

template <typename Base>
struct policy2 : Base
{
};

template <typename Policy1, typename Policy2>
struct example : Policy1<Policy2>
{
};

-- 
Rob Stewart                           stewart_at_[hidden]
Software Engineer                     http://www.sig.com
Susquehanna International Group, LLP  using std::disclaimer;

Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk