We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 62a6558 commit 5d2d879Copy full SHA for 5d2d879
gtsam/hybrid/HybridConditional.h
@@ -166,12 +166,13 @@ class GTSAM_EXPORT HybridConditional
166
}
167
168
/**
169
- * @brief Return conditional as a DiscreteConditional
+ * @brief Return conditional as a DiscreteConditional or specified type T.
170
* @return nullptr if not a DiscreteConditional
171
* @return DiscreteConditional::shared_ptr
172
*/
173
- DiscreteConditional::shared_ptr asDiscrete() const {
174
- return std::dynamic_pointer_cast<DiscreteConditional>(inner_);
+ template <typename T = DiscreteConditional>
+ typename T::shared_ptr asDiscrete() const {
175
+ return std::dynamic_pointer_cast<T>(inner_);
176
177
178
/// Get the type-erased pointer to the inner type
0 commit comments