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() { template <class T> T& edit() {
auto theConcept = std::dynamic_pointer_cast<typename T::JobModel>(_concept); auto theConcept = std::dynamic_pointer_cast<typename T::JobModel>(_concept);
if (theConcept) { assert(theConcept);
return theConcept->_data; return theConcept->_data;
}
assert(false);
return T();
} }
template <class T> const T& get() const { template <class T> const T& get() const {
auto theConcept = std::dynamic_pointer_cast<typename T::JobModel>(_concept); auto theConcept = std::dynamic_pointer_cast<typename T::JobModel>(_concept);
if (theConcept) { assert(theConcept);
return theConcept->_data; return theConcept->_data;
}
assert(false);
return T();
} }
void run(const SceneContextPointer& sceneContext, const RenderContextPointer& renderContext) { void run(const SceneContextPointer& sceneContext, const RenderContextPointer& renderContext) {