@@ -522,21 +522,25 @@ inline Expected<Timestamp> TreeNode::getInputStamped(const std::string& key,
522
522
{
523
523
// Support vector<Any> -> vector<typename T::value_type> conversion.
524
524
// Only want to compile this path when T is a vector type.
525
- if constexpr (is_vector<T>::value)
525
+ if constexpr (is_vector<T>::value)
526
526
{
527
- if (!std::is_same_v<T, std::vector<Any>> && any_value.type () == typeid (std::vector<Any>))
527
+ if (!std::is_same_v<T, std::vector<Any>> &&
528
+ any_value.type () == typeid (std::vector<Any>))
528
529
{
529
530
// If the object was originally placed on the blackboard as a vector<Any>, attempt to unwrap the vector
530
531
// elements according to the templated type.
531
532
auto any_vec = any_value.cast <std::vector<Any>>();
532
- if (!any_vec.empty () && any_vec.front ().type () != typeid (typename T::value_type))
533
+ if (!any_vec.empty () &&
534
+ any_vec.front ().type () != typeid (typename T::value_type))
533
535
{
534
- return nonstd::make_unexpected (" Invalid cast requested from vector<Any> to vector<typename T::value_type>."
536
+ return nonstd::make_unexpected (" Invalid cast requested from vector<Any> to "
537
+ " vector<typename T::value_type>."
535
538
" Element type does not align." );
536
539
}
537
540
destination = T ();
538
- std::transform (any_vec.begin (), any_vec.end (), std::back_inserter (destination),
539
- [](Any &element) { return element.cast <typename T::value_type>(); });
541
+ std::transform (
542
+ any_vec.begin (), any_vec.end (), std::back_inserter (destination),
543
+ [](Any& element) { return element.cast <typename T::value_type>(); });
540
544
return Timestamp{ entry->sequence_id , entry->stamp };
541
545
}
542
546
}
@@ -618,7 +622,7 @@ inline Result TreeNode::setOutput(const std::string& key, const T& value)
618
622
// If the object is a vector but not a vector<Any>, convert it to vector<Any> before placing it on the blackboard.
619
623
auto any_vec = std::vector<Any>();
620
624
std::transform (value.begin (), value.end (), std::back_inserter (any_vec),
621
- [](const auto & element) { return BT::Any (element); });
625
+ [](const auto & element) { return BT::Any (element); });
622
626
config ().blackboard ->set (static_cast <std::string>(remapped_key), any_vec);
623
627
}
624
628
else
0 commit comments