Val: cast_value_to_type() returns IntrusivePtr

This commit is contained in:
Max Kellermann 2020-02-27 10:15:03 +01:00
parent 96951c1300
commit 3331abb4f2
4 changed files with 6 additions and 8 deletions

View file

@ -1037,10 +1037,9 @@ extern void delete_vals(val_list* vals);
inline bool is_vector(Val* v) { return v->Type()->Tag() == TYPE_VECTOR; }
// Returns v casted to type T if the type supports that. Returns null if not.
// The returned value will be ref'ed.
//
// Note: This implements the script-level cast operator.
extern Val* cast_value_to_type(Val* v, BroType* t);
extern IntrusivePtr<Val> cast_value_to_type(Val* v, BroType* t);
// Returns true if v can be casted to type T. If so, check_and_cast() will
// succeed as well.