Combine enable_if and concept check

View: New views
2 Messages — Rating Filter:   Alert me  

Combine enable_if and concept check

by Johan Torp :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Is there any way to combine boost::enable_if and the concept check library? For instance to disable a function overload for template parameters which doesn't model some STL concept.

Best Regards, Johan Torp


Re: Combine enable_if and concept check

by David Abrahams :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message


on Wed Jan 30 2008, Johan Torp <johan.torp-AT-gmail.com> wrote:

> Is there any way to combine boost::enable_if and the concept check library?
> For instance to disable a function overload for template parameters which
> doesn't model some STL concept.

Nope.  Those concepts perform checks that cause hard compile-time
errors.  Once they've failed, it's too late to recover... and not all
concept check failures can be converted to non-error true/false results
in C++03.

--
Dave Abrahams
Boost Consulting
http://boost-consulting.com

_______________________________________________
Unsubscribe & other changes: http://lists.boost.org/mailman/listinfo.cgi/boost