diff options
author | jthorn <jthorn@f88db872-0e4f-0410-b76b-b9085cfa78c5> | 2002-10-06 21:15:10 +0000 |
---|---|---|
committer | jthorn <jthorn@f88db872-0e4f-0410-b76b-b9085cfa78c5> | 2002-10-06 21:15:10 +0000 |
commit | 0ee06d6401af026bd4bd70e173c7fd66d467b38e (patch) | |
tree | 037345eff6e49bcca9cd47f43c89aa18056bd7da /src/jtutil | |
parent | 7738ae27379fd4aee0124bd3b224295fcaf5cfce (diff) |
fix template instantiation syntax for fuzzy::tolerance
Thanks to Thomas Mang <a9804814@unet.univie.ac.at> for answering
my comp.lang.c++.moderated query on what syntax is correct here!
git-svn-id: http://svn.einsteintoolkit.org/cactus/EinsteinAnalysis/AHFinderDirect/trunk@796 f88db872-0e4f-0410-b76b-b9085cfa78c5
Diffstat (limited to 'src/jtutil')
-rw-r--r-- | src/jtutil/fuzzy.cc | 18 |
1 files changed, 16 insertions, 2 deletions
diff --git a/src/jtutil/fuzzy.cc b/src/jtutil/fuzzy.cc index 581adfe..b1547f9 100644 --- a/src/jtutil/fuzzy.cc +++ b/src/jtutil/fuzzy.cc @@ -73,10 +73,24 @@ return fuzzy<fp>::is_integer(x) // ***** template instantiations ***** // +// +// Thanks to Thomas Mang <a9804814@unet.univie.ac.at> for answering +// my comp.lang.c++.moderated query on what syntax is correct here! +// + +namespace jtutil + { +// dummy generic version of fuzzy::tolerance (unused) +template <typename fp> + fp fuzzy<fp>::tolerance = 0.0; + // instantiation for <float> template class jtutil::fuzzy<float>; -float jtutil::fuzzy<float>::tolerance = 1.0e-5; // about 100 * FLT_EPSILON +template<> + float fuzzy<float>::tolerance = 1.0e-5; // about 100 * FLT_EPSILON // instantiations for <double> template class jtutil::fuzzy<double>; -double jtutil::fuzzy<double>::tolerance = 1.0e-12; // about 1e4 * DBL_EPSILON +template<> + double fuzzy<double>::tolerance = 1.0e-12; // about 1e4 * DBL_EPSILON + } // namespace jtutil:: |