#include <vector>
#include <boost/concept/requires.hpp>
#include <boost/range/concepts.hpp>
#include <boost/utility/enable_if.hpp>
#include <boost/type_traits/is_same.hpp>
template <typename T>
BOOST_CONCEPT_REQUIRES(
(( boost::SinglePassRangeConcept<T> )),
// ( void ))
( typename boost::enable_if<boost::is_same<typename boost::range_value<T>::type, int>, void>::type ))
f( const T & ) { }
int main( )
{
std::vector<int> v;
f( v );
}
g++ -c -o enable_if.o enable_if.cpp
enable_if.cpp: In function ‘int main()’:
enable_if.cpp:17: error: no matching function for call to ‘f(std::vector<int, std::allocator<int> >&)’