How would I define a function that takes as input an iterator over any type of STL container, but only to those of a specific templated type. For example:
Any iterator o
You only want to iterate over containers of my_special_type
? In that case:
template
struct enable_if;
template
struct enable_if
{
typedef T type;
};
template
struct is_same
{
enum {value = false};
};
template
struct is_same
{
enum {value = true};
};
template
typename enable_if::value,
void>::type
function(Iter begin, Iter end)
{
// ...
}