From b9035c05154a6dcdadb89b12bb40b7ce1bc764f8 Mon Sep 17 00:00:00 2001 From: Dan Goodliffe Date: Thu, 22 Mar 2018 20:37:47 +0000 Subject: Rearrange the code to remove explicit instantiation after implicit warning --- slicer/slicer/modelPartsTypes.cpp | 18 +++++++++--------- slicer/slicer/modelPartsTypes.impl.h | 6 +++--- 2 files changed, 12 insertions(+), 12 deletions(-) diff --git a/slicer/slicer/modelPartsTypes.cpp b/slicer/slicer/modelPartsTypes.cpp index 65ede97..3adff5a 100644 --- a/slicer/slicer/modelPartsTypes.cpp +++ b/slicer/slicer/modelPartsTypes.cpp @@ -57,15 +57,6 @@ namespace Slicer { return name; } - MODELPARTFOR(std::string, ModelPartForSimple); - MODELPARTFOR(bool, ModelPartForSimple); - MODELPARTFOR(Ice::Float, ModelPartForSimple); - MODELPARTFOR(Ice::Double, ModelPartForSimple); - MODELPARTFOR(Ice::Byte, ModelPartForSimple); - MODELPARTFOR(Ice::Short, ModelPartForSimple); - MODELPARTFOR(Ice::Int, ModelPartForSimple); - MODELPARTFOR(Ice::Long, ModelPartForSimple); - template<> const std::string Slicer::ModelPartForRoot::rootName = "String"; template<> const std::string Slicer::ModelPartForRoot::rootName = "Boolean"; template<> const std::string Slicer::ModelPartForRoot::rootName = "Float"; @@ -84,6 +75,15 @@ namespace Slicer { template<> const std::string Slicer::ModelPartForRoot>::rootName = "OptionalInt"; template<> const std::string Slicer::ModelPartForRoot>::rootName = "OptionalLong"; + MODELPARTFOR(std::string, ModelPartForSimple); + MODELPARTFOR(bool, ModelPartForSimple); + MODELPARTFOR(Ice::Float, ModelPartForSimple); + MODELPARTFOR(Ice::Double, ModelPartForSimple); + MODELPARTFOR(Ice::Byte, ModelPartForSimple); + MODELPARTFOR(Ice::Short, ModelPartForSimple); + MODELPARTFOR(Ice::Int, ModelPartForSimple); + MODELPARTFOR(Ice::Long, ModelPartForSimple); + bool optionalCaseEq(const std::string & a, const std::string & b, bool matchCase) { diff --git a/slicer/slicer/modelPartsTypes.impl.h b/slicer/slicer/modelPartsTypes.impl.h index 149bb1d..017d243 100644 --- a/slicer/slicer/modelPartsTypes.impl.h +++ b/slicer/slicer/modelPartsTypes.impl.h @@ -13,9 +13,6 @@ #include #define CUSTOMMODELPARTFOR(Type, BaseModelPart, ModelPartType) \ - template class BaseModelPart; \ - template class ModelPartForRoot; \ - template class ModelPartForRoot< IceUtil::Optional >; \ template<> ModelPartPtr ModelPart::CreateFor() { return new ModelPartType(nullptr); } \ template<> ModelPartPtr ModelPart::CreateFor(Type & s) { return new ModelPartType(&s); } \ template<> ModelPartPtr ModelPart::CreateFor(const Type & s) { return CreateFor(const_cast(s)); } \ @@ -25,6 +22,9 @@ template<> ModelPartForRootPtr ModelPart::CreateRootFor(IceUtil::Optional & s) { return new ModelPartForRoot >(&s); } \ template<> ModelPartForRootPtr ModelPart::CreateRootFor(const Type & s) { return CreateRootFor(const_cast(s)); } \ template<> ModelPartForRootPtr ModelPart::CreateRootFor(const IceUtil::Optional & s) { return CreateRootFor(const_cast &>(s)); } \ + template class BaseModelPart; \ + template class ModelPartForRoot; \ + template class ModelPartForRoot< IceUtil::Optional >; \ #define MODELPARTFOR(Type, ModelPartType) \ CUSTOMMODELPARTFOR(Type, ModelPartType, ModelPartType) -- cgit v1.2.3