From: Brian McNamara (lorgon_at_[hidden])
Date: 2003-10-23 22:14:07
On Fri, Oct 24, 2003 at 09:25:54AM +0800, Joel de Guzman wrote:
> Well, I was kinda hoping that you have a trick up your sleeve :->
> If you can think of something better, I'm all ears.
Perhaps I am stuck in a mental rut, but it's hard for me to imagine
anything better than the enable_if solution for something like this.
- you want to write a template function which only works on arguments
that meet some certain criteria
- enable_if ensures that the function only 'exists' for arguments that
meet criteria specified by a value/metafunction, and
- writing the (is_XXX) metafunction to define the criteria is
So, I'm not sure why this solution would seem unsatisfying, or why you'd
be looking for something "better". (Or maybe I'm putting words in your
mouth by suggesting you find it dissatisfying.)
What qualities would a "better" solution have? More concise to write?
Faster compile-time? Something else? Maybe I do have the right trick
somewhere in my bag-o-tricks, but I'm not sure what I'm looking for. :)
-- -Brian McNamara (lorgon_at_[hidden])
Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk