Skip to content

Commit

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

Pull Request resolved: #11273

Reviewed By: kevinwilfong

Differential Revision: D64356475

fbshipit-source-id: 6c5bac796f7b628ebb4d73356106ca5edc5ce345
  • Loading branch information
Yuhta authored and facebook-github-bot committed Oct 28, 2024
1 parent a1d923e commit b24e1e6
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 b24e1e6

Please sign in to comment.