Skip to content

Commit

Permalink
Add fb_regex_match_any (facebookincubator#11273)
Browse files Browse the repository at this point in the history
Summary:
X-link: facebookexternal/presto-facebook#3019


Reviewed By: kevinwilfong

Differential Revision: D64356475
  • Loading branch information
Yuhta authored and facebook-github-bot committed Oct 24, 2024
1 parent cd58af0 commit 7bb593e
Showing 1 changed file with 22 additions and 0 deletions.
22 changes: 22 additions & 0 deletions velox/vector/BaseVector.h
Original file line number Diff line number Diff line change
Expand Up @@ -145,6 +145,28 @@ class BaseVector {
return static_cast<const T*>(this);
}

template <typename T>
T* asChecked() {
auto* casted = as<T>();
VELOX_CHECK_NOT_NULL(
casted,
"Wrong type cast expected {}, but got {}",
typeid(T).name(),
typeid(*this).name());
return casted;
}

template <typename T>
const T* asChecked() const {
auto* casted = as<T>();
VELOX_CHECK_NOT_NULL(
casted,
"Wrong type cast expected {}, but got {}",
typeid(T).name(),
typeid(*this).name());
return casted;
}

template <typename T>
const FlatVector<T>* asFlatVector() const {
return dynamic_cast<const FlatVector<T>*>(this);
Expand Down

0 comments on commit 7bb593e

Please sign in to comment.