Image

Imagecgs3408h4x wrote in Imagecpp 😤working

Listens: George Strait- You'll Be There

Question About Templates

I am having a hard time grasping the difference between these two forms of syntax when dealing with templates:

  • What is the difference between a class template and a function template?
    • A function template is a function whos definition uses templated parameters.
    • A class template is a class in which the objects created are templated. Such objects are created by doing MyClass <int> c1;
    I am safe to say this, correct?
  • What is a forward declaration of a class and when do I need one?
  • And finally, what is the difference between:
    template <class T>
    and
    template <typename T>
Thank you for any help!