R
Rajan
Hi All C++ experts
My problem is regarding calling templatise class function
please see the code snip shot
#include<iostream>
using namespace std
void fun(char*);
void fun(char*)
{
}
class NULLPointer
{
public:
template<class T>
operator T*()
{
return 0;
}
}
int main()
{
NULLPointer Null;
fun(Null); // Error : not able to convert NULLPointer to char*
}
problems:
(1) how to call solve above problem
(2)If suppose there is a function like in the class
template<class T>
T* test()
{
return 0;
}
How to call this function from main function
Thanks in advance
Raj
My problem is regarding calling templatise class function
please see the code snip shot
#include<iostream>
using namespace std
void fun(char*);
void fun(char*)
{
}
class NULLPointer
{
public:
template<class T>
operator T*()
{
return 0;
}
}
int main()
{
NULLPointer Null;
fun(Null); // Error : not able to convert NULLPointer to char*
}
problems:
(1) how to call solve above problem
(2)If suppose there is a function like in the class
template<class T>
T* test()
{
return 0;
}
How to call this function from main function
Thanks in advance
Raj