-
Notifications
You must be signed in to change notification settings - Fork 0
Open
Description
Template the view iterator (which is a forwards iterator) using the type of the underlying C++ iterator. Specialise it for the two possible types of C++ iterators (forwards and reverse).
Specialisation is demonstrated in the working example below.
#include <iostream>
template<typename T>
struct Stuff
{
int foo(void);
};
template<typename T>
int Stuff<T>::foo(void)
{
return 1;
}
template<>
int Stuff<long>::foo(void)
{
return -1;
}
int main(void)
{
std::cout << Stuff<long>().foo() << '\n';
std::cout << Stuff<bool>().foo() << '\n';
}
Metadata
Metadata
Assignees
Labels
No labels