FIxing the compil bug by checking security of the call with assert and avoiding the compilation error

This commit is contained in:
samcake 2015-12-15 22:07:06 -08:00
parent a60ef4fb5a
commit 1364329886

View file

@ -86,19 +86,13 @@ public:
template <class T> T& edit() {
auto theConcept = std::dynamic_pointer_cast<typename T::JobModel>(_concept);
if (theConcept) {
return theConcept->_data;
}
assert(false);
return T();
assert(theConcept);
return theConcept->_data;
}
template <class T> const T& get() const {
auto theConcept = std::dynamic_pointer_cast<typename T::JobModel>(_concept);
if (theConcept) {
return theConcept->_data;
}
assert(false);
return T();
assert(theConcept);
return theConcept->_data;
}
void run(const SceneContextPointer& sceneContext, const RenderContextPointer& renderContext) {