aboutsummaryrefslogtreecommitdiff
path: root/build/target.cxx
diff options
context:
space:
mode:
authorBoris Kolpackov <boris@codesynthesis.com>2015-06-30 15:07:03 +0200
committerBoris Kolpackov <boris@codesynthesis.com>2015-06-30 15:07:03 +0200
commit70af0087d8efb3f2f7dc9ffdf2568419913f16da (patch)
treedceeab7a3c600add8bf3f3375a2d83ca11213624 /build/target.cxx
parent18568ff0ff3dce89d694b494c5dfc9a32e63c9e6 (diff)
Group "see through" iteration, take 1
Diffstat (limited to 'build/target.cxx')
-rw-r--r--build/target.cxx12
1 files changed, 12 insertions, 0 deletions
diff --git a/build/target.cxx b/build/target.cxx
index 6cd1fc9..ec96779 100644
--- a/build/target.cxx
+++ b/build/target.cxx
@@ -17,6 +17,18 @@ using namespace std;
namespace build
{
+ // target_type
+ //
+ bool target_type::
+ is_a (const type_index& id) const
+ {
+ for (const target_type* p (this); p != nullptr; p = p->base)
+ if (p->id == id)
+ return true;
+
+ return false;
+ }
+
// target_state
//
static const char* target_state_[] = {