mirror of
https://github.com/IfcOpenShell/IfcOpenShell.git
synced 2026-08-11 18:16:40 +00:00
Fix errors on clang
This commit is contained in:
+21
-11
@@ -129,19 +129,10 @@ namespace IfcUtil {
|
||||
Argument* get(const std::string& name) const;
|
||||
|
||||
template <typename T>
|
||||
T get_value(const std::string& name) const {
|
||||
auto attr = get(name);
|
||||
return (T)*attr;
|
||||
}
|
||||
T get_value(const std::string& name) const;
|
||||
|
||||
template <typename T>
|
||||
T get_value(const std::string& name, const T& default_value) const {
|
||||
auto attr = get(name);
|
||||
if (attr->isNull()) {
|
||||
return default_value;
|
||||
}
|
||||
return (T)*attr;
|
||||
}
|
||||
T get_value(const std::string& name, const T& default_value) const;
|
||||
|
||||
boost::shared_ptr<aggregate_of_instance> get_inverse(const std::string& a) const;
|
||||
};
|
||||
@@ -157,4 +148,23 @@ namespace IfcUtil {
|
||||
|
||||
}
|
||||
|
||||
#include "../ifcparse/Argument.h"
|
||||
|
||||
namespace IfcUtil {
|
||||
template <typename T>
|
||||
T IfcBaseEntity::get_value(const std::string& name) const {
|
||||
auto attr = get(name);
|
||||
return (T)*attr;
|
||||
}
|
||||
|
||||
template <typename T>
|
||||
T IfcBaseEntity::get_value(const std::string& name, const T& default_value) const {
|
||||
auto attr = get(name);
|
||||
if (attr->isNull()) {
|
||||
return default_value;
|
||||
}
|
||||
return (T)*attr;
|
||||
}
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
Reference in New Issue
Block a user