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

Function any_cast

include/behaviortree_cpp/contrib/any.hpp:467–474  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

465/// Performs *any_cast<add_const_t<remove_reference_t<ValueType>>>(&operand), or throws bad_any_cast on failure.
466template<typename ValueType>
467inline ValueType any_cast(const any& operand)
468{
469 auto p = any_cast<typename std::add_const<typename std::remove_reference<ValueType>::type>::type>(&operand);
470#ifndef ANY_IMPL_NO_EXCEPTIONS
471 if(p == nullptr) throw bad_any_cast();
472#endif
473 return *p;
474}
475
476/// Performs *any_cast<remove_reference_t<ValueType>>(&operand), or throws bad_any_cast on failure.
477template<typename ValueType>

Callers

nothing calls this directly

Calls 2

bad_any_castClass · 0.85
is_typedMethod · 0.80

Tested by

no test coverage detected