compiler : visual c++ 2010
os : windows 7 64bits
learning template and encounter some problem
template<typename T>
void easyCopyImpl(T const &A, typename boost::enable_if_c< boost::is_array<T>::value>::type *temp = 0)
{
std::cout<<"this is array"<<std::endl;
std::cout<<typeid(T).name()<<std::endl;
std::copy(A, A + sizeof_array(A), typename std::ostream_iterator<T>(std::cout, "") );
}
template<typename T>
void easyCopyImpl(T const &A, typename boost::enable_if_c< boost::is_class<T>::value>::type *temp = 0)
{
std::cout<<"this is class"<<std::endl;
//std::copy(A.begin(), A.end(), std::ostream_iterator<T>(std::cout, "") );
}
template<typename T>
void easyCopy(T const &A)
{
easyCopyImpl(A);
}
int main()
{
int A[] = {1, 2, 3, 4};
easyCopy(A);
}
It would pop out a lot of error messages
What is the problem and how could I solve it?Thanks