I have class:
template <class T> class Graph;
And I have a function:
template <class T>
void Graph<T>::erase_greater(T needle)
{
if(TEMPLATE TYPE IS "STRING" OR "CHAR")
{
do nothing;
} else
{
if(TEMPLATE TYPE IS ONE OF THE INT TYPES)
{
if(strlen(var1) > strlen(var2))
{
USE Var2;
} else
{
USE Var1;
}
}
....
}
-----------
2nd question:
I have a struct:
struct graph2D {
int id;
bool matrix[50][50];
}
But I want to initalize the size of matrix only in main():
struct graph2D(int size) {
int id;
bool j[size][size];
};
int main()
{
graph2D(tmpvector.size()) MyMatrix;
}
But as I understand, this one don't work.
Thanks for any help.