summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDan Goodliffe <dan@randomdan.homeip.net>2018-03-22 20:37:47 +0000
committerDan Goodliffe <dan@randomdan.homeip.net>2018-03-22 20:37:47 +0000
commitb9035c05154a6dcdadb89b12bb40b7ce1bc764f8 (patch)
tree3bee73e47c4ca1feb70bbbf80039f9a4ede48505
parentRemove unneeded include (diff)
downloadslicer-b9035c05154a6dcdadb89b12bb40b7ce1bc764f8.tar.bz2
slicer-b9035c05154a6dcdadb89b12bb40b7ce1bc764f8.tar.xz
slicer-b9035c05154a6dcdadb89b12bb40b7ce1bc764f8.zip
Rearrange the code to remove explicit instantiation after implicit warning
-rw-r--r--slicer/slicer/modelPartsTypes.cpp18
-rw-r--r--slicer/slicer/modelPartsTypes.impl.h6
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<std::string>::rootName = "String";
template<> const std::string Slicer::ModelPartForRoot<bool>::rootName = "Boolean";
template<> const std::string Slicer::ModelPartForRoot<Ice::Float>::rootName = "Float";
@@ -84,6 +75,15 @@ namespace Slicer {
template<> const std::string Slicer::ModelPartForRoot<IceUtil::Optional<Ice::Int>>::rootName = "OptionalInt";
template<> const std::string Slicer::ModelPartForRoot<IceUtil::Optional<Ice::Long>>::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 <boost/algorithm/string/case_conv.hpp>
#define CUSTOMMODELPARTFOR(Type, BaseModelPart, ModelPartType) \
- template class BaseModelPart; \
- template class ModelPartForRoot<Type>; \
- template class ModelPartForRoot< IceUtil::Optional<Type> >; \
template<> ModelPartPtr ModelPart::CreateFor<Type>() { 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<Type &>(s)); } \
@@ -25,6 +22,9 @@
template<> ModelPartForRootPtr ModelPart::CreateRootFor(IceUtil::Optional<Type> & s) { return new ModelPartForRoot<IceUtil::Optional<Type> >(&s); } \
template<> ModelPartForRootPtr ModelPart::CreateRootFor(const Type & s) { return CreateRootFor(const_cast<Type &>(s)); } \
template<> ModelPartForRootPtr ModelPart::CreateRootFor(const IceUtil::Optional<Type> & s) { return CreateRootFor(const_cast<IceUtil::Optional<Type> &>(s)); } \
+ template class BaseModelPart; \
+ template class ModelPartForRoot<Type>; \
+ template class ModelPartForRoot< IceUtil::Optional<Type> >; \
#define MODELPARTFOR(Type, ModelPartType) \
CUSTOMMODELPARTFOR(Type, ModelPartType<Type>, ModelPartType<Type>)