From ee0cb57cd9ecf8bb2ee6de810c617e86baf6bf7e Mon Sep 17 00:00:00 2001 From: Mark Olesen Date: Tue, 12 Oct 2010 12:17:13 +0200 Subject: [PATCH] COMP: specializations of templates within namespace Foam - otherwise gets flagged as an error by clang --- .../Tensor/labelTensor/labelTensor.C | 49 ++++++++++--------- .../Vector/labelVector/labelVector.C | 20 ++++---- 2 files changed, 37 insertions(+), 32 deletions(-) diff --git a/src/OpenFOAM/primitives/Tensor/labelTensor/labelTensor.C b/src/OpenFOAM/primitives/Tensor/labelTensor/labelTensor.C index 63419832af..e8a189f094 100644 --- a/src/OpenFOAM/primitives/Tensor/labelTensor/labelTensor.C +++ b/src/OpenFOAM/primitives/Tensor/labelTensor/labelTensor.C @@ -28,32 +28,35 @@ License // * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * // -template<> -const char* const Foam::labelTensor::typeName = "labelTensor"; - -template<> -const char* Foam::labelTensor::componentNames[] = +namespace Foam { - "xx", "xy", "xz", - "yx", "yy", "yz", - "zx", "zy", "zz" -}; + template<> + const char* const Foam::labelTensor::typeName = "labelTensor"; -template<> -const Foam::labelTensor Foam::labelTensor::zero -( - 0, 0, 0, - 0, 0, 0, - 0, 0, 0 -); + template<> + const char* Foam::labelTensor::componentNames[] = + { + "xx", "xy", "xz", + "yx", "yy", "yz", + "zx", "zy", "zz" + }; -template<> -const Foam::labelTensor Foam::labelTensor::one -( - 1, 1, 1, - 1, 1, 1, - 1, 1, 1 -); + template<> + const Foam::labelTensor Foam::labelTensor::zero + ( + 0, 0, 0, + 0, 0, 0, + 0, 0, 0 + ); + + template<> + const Foam::labelTensor Foam::labelTensor::one + ( + 1, 1, 1, + 1, 1, 1, + 1, 1, 1 + ); +} // ************************************************************************* // diff --git a/src/OpenFOAM/primitives/Vector/labelVector/labelVector.C b/src/OpenFOAM/primitives/Vector/labelVector/labelVector.C index b7473ee50e..c98da288cf 100644 --- a/src/OpenFOAM/primitives/Vector/labelVector/labelVector.C +++ b/src/OpenFOAM/primitives/Vector/labelVector/labelVector.C @@ -27,17 +27,19 @@ License // * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * // -template<> -const char* const Foam::labelVector::typeName = "labelVector"; +namespace Foam +{ + template<> + const char* const Foam::labelVector::typeName = "labelVector"; -template<> -const char* Foam::labelVector::componentNames[] = {"x", "y", "z"}; + template<> + const char* Foam::labelVector::componentNames[] = {"x", "y", "z"}; -template<> -const Foam::labelVector Foam::labelVector::zero(0, 0, 0); - -template<> -const Foam::labelVector Foam::labelVector::one(1, 1, 1); + template<> + const Foam::labelVector Foam::labelVector::zero(0, 0, 0); + template<> + const Foam::labelVector Foam::labelVector::one(1, 1, 1); +} // ************************************************************************* //