On 19 Mar, 19:19, Fei Liu <fei...@aepnetworks.comwrote:
Of course when you declare a class data structure, use 'class'. Only
place I am aware of that typename cannot replace class keyword.
Other place is template template params e.g:
// for allocator
#include <memory>
// can't replace 'class' with typename below
template <template<typename, typenameclass Seq>
struct F{
template <typename T>
void foo( Seq<T,std::allocator<T const & seq)
{
std::cout << *seq.begin() <<'\n';
}
};
#include <vector>
#include <iostream>
int main()
{
std::vector<intx;
F<std::vectorf;
x.push_back(1);
f.foo(x);
}
regards
Andy Little