odeint のステッパー クラスでいくつかの作業を実行できるテンプレート化されたクラスがあり、それをステッパーのカテゴリごとに特定の (異なる) 作業にしたいと考えています。
/// header file ///
template<class Stepper>
class foo {
typedef typename boost::numeric::odeint::unwrap_reference< Stepper >::type::stepper_category stepper_category;
void do_work(double param);
// specific functions for various stepper types
void do_specific_work(double param, stepper_category);
}
/// cpp file ///
template<class Stepper>
void foo<Stepper>::do_work(double param)
{
do_specific_work(param, stepper_category());
}
// actual implementation of work for any stepper (i.e. exposing the basic functionality of stepper_tag)
template<class Stepper>
void foo<Stepper>::do_specific_work(double param, boost::numeric::odeint::stepper_tag)
{ ... }
// actual implementation of work for dense output stepper (i.e. exposing the functionality of dense_output_stepper_tag)
template<class Stepper>
void foo<Stepper>::do_specific_work(double param, boost::numeric::odeint::dense_output_stepper_tag)
{ ... }
問題は、次のコンパイラ エラーが発生することです。
error C2244: 'foo<Stepper>::do_specific_work' : unable to match function definition to an existing declaration`
などのメソッドが実装されているのと同じ方法で実行しようとしましたがintegrate_adaptive、私の場合との違いは、それらがスタンドアロン関数 (クラスのメンバーではない) であり、前方宣言を必要としないことです。必要なものを達成するためにコードを変更する方法は? 前もって感謝します!