diff options
author | Nick Fitzgerald <fitzgen@gmail.com> | 2016-11-07 14:09:40 -0800 |
---|---|---|
committer | Nick Fitzgerald <fitzgen@gmail.com> | 2016-11-07 14:09:40 -0800 |
commit | 4d45f83d1ed0c768795080cd0af87f5d06089da0 (patch) | |
tree | d6fbba357e1c47a355175b34eca4040cc178ca47 | |
parent | cc82b839b164f38513dcdcc93a63d654c82ca80c (diff) |
Add `clang::Type::is_valid`
A helper for checking if the type's kind is not `CXType_Invalid`.
-rwxr-xr-x | src/clang.rs | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/src/clang.rs b/src/clang.rs index a11e2924..b250e548 100755 --- a/src/clang.rs +++ b/src/clang.rs @@ -715,6 +715,11 @@ impl Type { } } } + + /// Is this a valid type? + pub fn is_valid(&self) -> bool { + self.kind() != CXType_Invalid + } } /// An iterator for a type's template arguments. |