Templates!

I had to rewrite programs to make that work with a template. I have done this, but in the directions it says I need to specify requirements on the template parameter type, and discuss the requirements on the template parameter type. I'm not exactly sure what I am supposed to do here. Could anyone help me with what this exactly means?

The template is used in an iterative and recursive binary search function.
I think the question is asking you do specify what kinds of types you should put in for the template parameter; i.e., what data types would be appropriate for T?
So if the templates are only for arrays of integers, that is what I would write?
> I need to specify requirements on the template parameter type,
> and discuss the requirements on the template parameter type.

For an example of a requirement on a type, see: http://en.cppreference.com/w/cpp/concept/EqualityComparable

The term 'concept' is used in C++ to specify named requirements for a type.
http://en.cppreference.com/w/cpp/concept
Topic archived. No new replies allowed.