Boost logo

Boost :

From: Lie-Quan Lee (llee1_at_[hidden])
Date: 2001-03-26 09:03:00


At Mon, 26 Mar 2001 08:41:54 -0500,
David Abrahams wrote:
>
> In the generative interfaces I have seen, the parameters name themselves.
> Using named template parameters is overkill in this situation. What we want,
> for ease-of-use, is simply an interface that allows the parameters to be
> passed in any order. That is,
>
> mutex_generator<checked, nonrecursive>::type
>
> is self-documenting, but should be equivalent to
>
> mutex_generator<nonrecursive, checked>::type
>
> -Dave
>

As a matter of fact, there are quite a few features in the mutexes. To
name a few, blocking policy, checked/unchecked,
recursive/nonrecursive, acquisition
scheduling(FIFO/priority/undefined), and owner priority and so
on.

Quickly, the number of template arguements could get larger than
convenient to remember. Benefits of using named template arguement,
including having default for all template arguements and making order
of template arguement insignificant, will make users' life easy as you
just suggest to do that in Boost.Graph. What do you think?

--
Cheers,
Lie-Quan Lee
> > -----Original Message-----
> > From: Lie-Quan Lee [mailto:llee1_at_[hidden]]
> > Sent: Monday, March 26, 2001 8:35 AM
> > To: boost_at_[hidden]
> > Subject: Re: [boost] Comments on the thread library
> >
> >
> > At Sun, 25 Mar 2001 13:30:44 -0500 (EST),
> > jeremy siek wrote:
> >
> > > For example, the mutex class is currently not as efficient as possible
> > > because it has to support a timed lock in addition to the usual
> > lock (see
> > > current discussion between Rich Lee and Bill). But who says we have to
> > > group these two kinds of locking into the same class! We need to
> > > orthogonalize the implementation and slap a generative interface on the
> > > whole thing!
> >
> > Agree! What I want to do is to use a policy-based design to have a
> > mutex generative interface so that users could a mutex with a
> > combination of features (for example, checked and nonrecursive, or
> > timed lock and unchecked) they want. In addtion, named template
> > arguement technique could be applied in the mutex case to create more
> > user friendly interface. To create such a mutex interface will be more
> > than joyful. However, I have to do other timed work in next a couple
> > of weeks. I will do that after I finished my timed work.
> >
> >
> > Rich
> >
> > Cheers,
> > --
> > Lie-Quan Lee
> >
> > To unsubscribe, send email to: <mailto:boost-unsubscribe_at_[hidden]>
> >
> >
> > Your use of Yahoo! Groups is subject to http://docs.yahoo.com/info/terms/
> >
> >
> 
> 
> To unsubscribe, send email to: <mailto:boost-unsubscribe_at_[hidden]>
>  
> 
> Your use of Yahoo! Groups is subject to http://docs.yahoo.com/info/terms/ 
> 
> 

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