
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/meta... 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...