Split get_default() into two for deferred default construction and added forwarding...
[folly.git] / folly / detail / IPAddress.cpp
index a830e1334480287ef4dfe169c0a1873b4907063a..c84814fba745c02a386032e4da76dd8d65d17e19 100644 (file)
 
 #include <folly/Format.h>
 
-namespace folly { namespace detail {
+namespace folly {
+namespace detail {
 
 std::string familyNameStrDefault(sa_family_t family) {
-  return folly::sformat("sa_family_t({})", folly::to<std::string>(family));
+  return sformat("sa_family_t({})", family);
 }
 
 [[noreturn]] void getNthMSBitImplThrow(size_t bitCount, sa_family_t family) {
-  throw std::invalid_argument(folly::to<std::string>(
-      "Bit index must be < ",
+  throw std::invalid_argument(sformat(
+      "Bit index must be < {} for addresses of type: {}",
       bitCount,
-      " for addresses of type :",
       familyNameStr(family)));
 }
-
-}}
+} // namespace detail
+} // namespace folly