Skip to content

Commit 1ce5185

Browse files
committed
Revert to direct type_index comparison in Blackboard::set()
Upcasting is not allowed for OUTPUT/INOUT port directions.
1 parent 5f94fea commit 1ce5185

File tree

1 file changed

+1
-4
lines changed

1 file changed

+1
-4
lines changed

include/behaviortree_cpp/blackboard.h

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -256,11 +256,8 @@ inline void Blackboard::set(const std::string& key, const T& value)
256256

257257
std::type_index previous_type = entry.info.type();
258258

259-
// allow matching if any is of the same base
260-
const auto current_type = TypeInfo::Create<T>().type();
261-
262259
// check type mismatch
263-
if(previous_type != current_type && previous_type != new_value.type())
260+
if(previous_type != std::type_index(typeid(T)) && previous_type != new_value.type())
264261
{
265262
bool mismatching = true;
266263
if(std::is_constructible<StringView, T>::value)

0 commit comments

Comments
 (0)