Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Correcting libstdc++ compiler error #65

Merged
merged 2 commits into from
Aug 20, 2014
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 15 additions & 4 deletions autowiring/MicroBolt.h
Original file line number Diff line number Diff line change
Expand Up @@ -17,15 +17,26 @@ template<typename T, typename... Sigils>
struct MicroBolt:
public Bolt<Sigils...>
{
private:
template<class W>
static bool LoopInject(const std::shared_ptr<CoreContext>& ctxt) {
for(auto context : ContextEnumeratorT<W>(ctxt))
// Inject<W>() is idempotent, that makes this behavior safe
context->template Inject<T>();
return true;
}

public:
MicroBolt(void) {
// ASSERT: Inject<T>() is idempotent.
// NOTE: Injection of T into all matching contexts may result in
// multiple calls to Inject<T>() if a matching context
// is created during traversal.
for(auto findSigil : {ContextEnumeratorT<Sigils>(CoreContext::CurrentContext())...})
for(auto context : findSigil)
context->template Inject<T>();
const auto ctxt = CoreContext::CurrentContext();
const bool dummy [] = {
LoopInject<Sigils>(ctxt)...,
false
};
(void)dummy;
}
void ContextCreated(void) override;
};
Expand Down
1 change: 1 addition & 0 deletions src/autowiring/test/BoltTest.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -211,6 +211,7 @@ class TargetBoltable: public Boltable<target> {
TargetBoltable() {++numCons;}
~TargetBoltable() {++numDest;}
};

template<class target>
int TargetBoltable<target>::numCons = 0;
template<class target>
Expand Down