No anonymous structs to work around gcc 5 issue

This commit is contained in:
Thomas Krijnen
2017-12-28 16:33:07 +01:00
parent 24b46c1f43
commit f5d6f4f7f9
2 changed files with 17 additions and 13 deletions
@@ -10,16 +10,19 @@ namespace IfcGeom {
#define MAKE_INIT_FN_(a, b) MAKE_INIT_FN__(a, b)
#define MAKE_INIT_FN(t) MAKE_INIT_FN_(t, IfcSchema)
template <typename P>
void MAKE_INIT_FN(IteratorImplementation_)(IteratorFactoryImplementation<P>* mapping) {
static const std::string schema_name = STRINGIFY(IfcSchema);
struct {
namespace {
template <typename P>
struct factory_t {
IfcGeom::IteratorImplementation<P>* operator()(const IfcGeom::IteratorSettings& settings, IfcParse::IfcFile* file) const {
return new IfcGeom::MAKE_TYPE_NAME(IteratorImplementation_)<P>(settings, file);
}
} factory;
};
}
template <typename P>
void MAKE_INIT_FN(IteratorImplementation_)(IteratorFactoryImplementation<P>* mapping) {
static const std::string schema_name = STRINGIFY(IfcSchema);
factory_t<P> factory;
mapping->bind(schema_name, factory);
}