[libc-commits] [PATCH] D119142: [libc][NFC] moving template specialization outside class declaration

Guillaume Chatelet via Phabricator via libc-commits libc-commits at lists.llvm.org
Tue Feb 8 02:36:04 PST 2022


This revision was automatically updated to reflect the committed changes.
Closed by commit rGc28a522fc75c: [libc][NFC] moving template specialization outside class declaration (authored by gchatelet).

Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D119142/new/

https://reviews.llvm.org/D119142

Files:
  libc/utils/MPFRWrapper/MPFRUtils.cpp


Index: libc/utils/MPFRWrapper/MPFRUtils.cpp
===================================================================
--- libc/utils/MPFRWrapper/MPFRUtils.cpp
+++ libc/utils/MPFRWrapper/MPFRUtils.cpp
@@ -392,16 +392,6 @@
   // These functions are useful for debugging.
   template <typename T> T as() const;
 
-  template <> float as<float>() const {
-    return mpfr_get_flt(value, mpfr_rounding);
-  }
-  template <> double as<double>() const {
-    return mpfr_get_d(value, mpfr_rounding);
-  }
-  template <> long double as<long double>() const {
-    return mpfr_get_ld(value, mpfr_rounding);
-  }
-
   void dump(const char *msg) const { mpfr_printf("%s%.128Rf\n", msg, value); }
 
   // Return the ULP (units-in-the-last-place) difference between the
@@ -488,6 +478,18 @@
   }
 };
 
+template <> float MPFRNumber::as<float>() const {
+  return mpfr_get_flt(value, mpfr_rounding);
+}
+
+template <> double MPFRNumber::as<double>() const {
+  return mpfr_get_d(value, mpfr_rounding);
+}
+
+template <> long double MPFRNumber::as<long double>() const {
+  return mpfr_get_ld(value, mpfr_rounding);
+}
+
 namespace internal {
 
 template <typename InputType>


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D119142.406745.patch
Type: text/x-patch
Size: 1155 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/libc-commits/attachments/20220208/6025ed57/attachment.bin>


More information about the libc-commits mailing list