Some fixes for clang

This commit is contained in:
Thomas Krijnen
2018-09-19 14:05:19 +02:00
parent 9a3039765f
commit e8b28a099f
8 changed files with 30 additions and 16 deletions
+7 -2
View File
@@ -38,6 +38,10 @@ namespace IfcUtil {
class IFC_PARSE_API IfcBaseClass {
protected:
IfcEntityInstanceData* data_;
static bool is_null(const IfcBaseClass* not_this) {
return !not_this;
}
public:
IfcBaseClass() : data_(0) {}
@@ -52,7 +56,8 @@ namespace IfcUtil {
template <class T>
T* as() {
if (this == 0) {
// @todo: do not allow this to be null in the first place
if (is_null(this)) {
return static_cast<T*>(0);
}
return declaration().is(T::Class())
@@ -62,7 +67,7 @@ namespace IfcUtil {
template <class T>
const T* as() const {
if (this == 0) {
if (is_null(this)) {
return static_cast<const T*>(0);
}
return declaration().is(T::Class())