make asDiscrete a template
parent
62a6558d85
commit
5d2d879462
|
|
@ -166,12 +166,13 @@ class GTSAM_EXPORT HybridConditional
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief Return conditional as a DiscreteConditional
|
* @brief Return conditional as a DiscreteConditional or specified type T.
|
||||||
* @return nullptr if not a DiscreteConditional
|
* @return nullptr if not a DiscreteConditional
|
||||||
* @return DiscreteConditional::shared_ptr
|
* @return DiscreteConditional::shared_ptr
|
||||||
*/
|
*/
|
||||||
DiscreteConditional::shared_ptr asDiscrete() const {
|
template <typename T = DiscreteConditional>
|
||||||
return std::dynamic_pointer_cast<DiscreteConditional>(inner_);
|
typename T::shared_ptr asDiscrete() const {
|
||||||
|
return std::dynamic_pointer_cast<T>(inner_);
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Get the type-erased pointer to the inner type
|
/// Get the type-erased pointer to the inner type
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue