From: bangerth Date: Mon, 5 Nov 2007 04:05:53 +0000 (+0000) Subject: Provide the ability to say NumberTraits::is_complex. X-Git-Url: https://gitweb.dealii.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=9f0ae8674c4b9978fa2d41bb7aec906ddffac731;p=dealii-svn.git Provide the ability to say NumberTraits::is_complex. git-svn-id: https://svn.dealii.org/trunk@15446 0785d39b-7218-0410-832d-ea1e28bc413d --- diff --git a/deal.II/base/include/base/numbers.h b/deal.II/base/include/base/numbers.h index 89751ec455..a4f5d647a3 100644 --- a/deal.II/base/include/base/numbers.h +++ b/deal.II/base/include/base/numbers.h @@ -169,6 +169,16 @@ namespace numbers template struct NumberTraits { + /** + * A flag that specifies whether the + * template type given to this class is + * complex or real. Since the general + * template is selected for non-complex + * types, the answer is + * false. + */ + static const bool is_complex = false; + /** * For this data type, typedef the * corresponding real type. Since the @@ -223,6 +233,17 @@ namespace numbers template struct NumberTraits > { + /** + * A flag that specifies whether the + * template type given to this class is + * complex or real. Since this + * specialization of the general + * template is selected for complex + * types, the answer is + * true. + */ + static const bool is_complex = true; + /** * For this data type, typedef the * corresponding real type. Since this diff --git a/deal.II/base/source/config.cc b/deal.II/base/source/config.cc index 890eca248e..9628f7f42d 100644 --- a/deal.II/base/source/config.cc +++ b/deal.II/base/source/config.cc @@ -66,6 +66,22 @@ namespace numbers && is_finite (x.imag()) ); } + + + template + const bool NumberTraits::is_complex; + + template + const bool NumberTraits >::is_complex; + +// explicit instantiations + template struct NumberTraits; + template struct NumberTraits; + template struct NumberTraits; + + template struct NumberTraits >; + template struct NumberTraits >; + template struct NumberTraits >; } DEAL_II_NAMESPACE_CLOSE