
please wait
function templates
with declaration and definition separately... Is it possible to write the declarations in the .h file and definitions in the .cpp file (as we would do if not using templates?unique
elements of a vector (created using this class of course), how I go about is creating a function template
(in a separate header, say widgets.h) as,
|
|
v.unique();
, return using the *this pointer. This will also change the contents of the calling object.function templates
, not class templates
. I am already using them. I decided to program certain utility functions to operate on the objects from the class I generated, using function templates.#ifndef #endif
. (While we are at it, could this #ifndef .. #endif be also applied to certain member functions or even function templates??)find
the row and column index of certain element in the matrix as a member function or as a function separately (outside the class by operating on the object)? The same goes to for example, calculating the inverse
of a matrix. How do you decide it?