我聲明瞭一個模板類threadBinaryTree
和功能NULL與模板參數不匹配?
void threadBinaryTree<T>::inThread
(threadBinaryTreeNode<T>*root,threadBinaryTreeNode<T>*& pre)
但符合錯誤:
no matching function for call to ‘threadBinaryTree<char>::inThread
(threadBinaryTreeNode<char>*, NULL)’|
pre
需要被初始化爲NULL,我應該怎麼辦?
東西你試過''nullptr''?就我所知,「NULL」不是C++。 –
從代碼中的簽名開始,pre必須引用現有的指針。 – Ashalynd
@Jonas'NULL'在C++中,因爲它在C stdlib中。儘管由於更好的重載解析行爲,'nullptr'是首選。 – rubenvb