Boost logo

Boost Users :

From: Noah Roberts (roberts.noah_at_[hidden])
Date: 2008-06-17 13:41:07


John Moeller wrote:
> Hello all,
>
> I am trying to make an "is_range" metafunction that (essentially) returns
> mpl::true_ when the template parameter is a range (as defined by the
> boost::range library).
>
> I can do this if I create a specialization for every "non-range" type currently
> specialized by the library (such as built-in arrays, char strings, etc.).
> However, I'd like to have is_range work for a user-defined range without the
> user *also* needing to specialize is_range.

Maybe try something like this:

http://unitlib.svn.sourceforge.net/viewvc/unitlib/trunk/include/unitlib/metafunc/is_quantity_operand.hpp?view=markup

Using techniques like that you should be able to generate a metafunction
that will check if an object instantiates a concept by checking all it's
public interface functions, types, etc...


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