MCPcopy Create free account
hub / github.com/BehaviorTree/BehaviorTree.CPP / castPtr

Method castPtr

include/behaviortree_cpp/utils/safe_any.hpp:184–190  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

182 // wrong type or if Any was empty.
183 template <typename T>
184 [[nodiscard]] T* castPtr()
185 {
186 static_assert(!std::is_same_v<T, float>, "The value has been casted internally to "
187 "[double]. Use that instead");
188
189 return _any.empty() ? nullptr : linb::any_cast<T>(&_any);
190 }
191
192 // This is the original type
193 [[nodiscard]] const std::type_index& type() const noexcept

Callers

nothing calls this directly

Calls 1

emptyMethod · 0.45

Tested by

no test coverage detected