From: Daniel Arndt Date: Mon, 11 Mar 2019 17:56:31 +0000 (+0100) Subject: Fix warnings in Convert::to_pattern() X-Git-Tag: v9.1.0-rc1~294^2 X-Git-Url: https://gitweb.dealii.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=refs%2Fpull%2F7797%2Fhead;p=dealii.git Fix warnings in Convert::to_pattern() --- diff --git a/include/deal.II/base/patterns.h b/include/deal.II/base/patterns.h index 3a8617fc91..bbb5b50adf 100644 --- a/include/deal.II/base/patterns.h +++ b/include/deal.II/base/patterns.h @@ -1493,22 +1493,38 @@ namespace Patterns struct Convert::value>::type> { - static std::unique_ptr - to_pattern() + template + static + typename std::enable_if::value && + std::is_same::value, + std::unique_ptr>::type + to_pattern() { - if (std::is_same::value) - return std_cxx14::make_unique(); - else if (std::is_integral::value) - return std_cxx14::make_unique( - static_cast(std::numeric_limits::lowest()), - static_cast(std::numeric_limits::max())); - else if (std::is_floating_point::value) - return std_cxx14::make_unique( - std::numeric_limits::lowest(), std::numeric_limits::max()); - - Assert(false, ExcNotImplemented()); - // the following line should never be invoked - return nullptr; + return std_cxx14::make_unique(); + } + + template + static + typename std::enable_if::value && + !std::is_same::value && + std::is_integral::value, + std::unique_ptr>::type + to_pattern() + { + return std_cxx14::make_unique( + std::numeric_limits::lowest(), std::numeric_limits::max()); + } + + template + static + typename std::enable_if::value && + !std::is_same::value && + std::is_floating_point::value, + std::unique_ptr>::type + to_pattern() + { + return std_cxx14::make_unique( + std::numeric_limits::lowest(), std::numeric_limits::max()); } static std::string