草庐IT

c++ - 更大类的单个方法的部分模板特化

我有以下类(class);templateclassBaumWelch{//lotsofstuffconstTransitionMatrixTemplaterandomA(){//....}}现在我想专门针对N=1的方法randomA。我该怎么做?我试着回答这个问题:Templatespecializationofasinglemethodfromatemplatedclass,但它似乎不适用于部分特化。本题:C++partialmethodspecialization似乎更相关,但它建议对整个类(class)进行特化(对我来说这相当大)。是否可以特化整个类,但实际上只特化这个方法?