While writing a template, I want to initialize my variable to a value that serves as zero or null the the data type. If I set it to 0x00 is it going to serve as zero/NULL for any type ?
for example
This is template declaration
template <class T>
...
T A=0x00;
Now if I define an instance of type T => std::string the above statement serves as NULL
?
What about "int
" and "unsigned int
". For both of the it serves as "0" ?
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…