15 Jul
2006
15 Jul
'06
4:15 a.m.
But consider the following code:
#include<iostream>
using namespace std;
class CMutex{};//Hide all the implementations for convience
template<class Y>
void world(Y * p)
{
}
void hello(int *x){
}
int main(){
hello(0);
world<CMutex>(0);
return 1;
}
It compiles and runs without problems.So you see I can pass zero as a
pointer to Y, and as a pointer to int. That's OK.
I wonder how it is implemented that we cannot pass zero as a pointer to Y in
the constructor of shared_ptr.
Thanks
Zhuo Hao
On 14/07/06, Tommy Hinks