假設你有一定的模板,需要一個參數類BOOST_ASSERT一個參數類實現一定的方法
template <typename ConnectorClass>
struct myClass {
}
我想添加一個BOOST_ASSERT_MSG
來驗證ConnectorClass
實現簽名的特定方法
returnType MethodName(param1, param2)
在這種情況下,我應該如何寫斷言條件?
編輯:因爲這個問題似乎並不有一個明確的解決方案,我張貼基於答案了一些參考資料與中間結果的子問題 請按照here
看看這個:http://stackoverflow.com/questions/3964357/how-to -tell-if-class-contains-a-certain-member-function-in-compile-time – 2010-10-25 15:04:13