/*
- * Copyright 2017 Facebook, Inc.
+ * Copyright 2014-present Facebook, Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
#include <string>
#include <type_traits>
-#include <folly/Conv.h>
+#include <folly/Format.h>
#include <folly/detail/IPAddress.h>
// BSDish platforms don't provide standard access to s6_addr16
0xff // /8
}};
if (oneMask > kBitCount || twoMask > kBitCount) {
- throw std::invalid_argument(folly::to<std::string>(
- "Invalid mask "
- "length: ",
- oneMask > twoMask ? oneMask : twoMask,
- ". Mask length must be <= ",
+ throw std::invalid_argument(sformat(
+ "Invalid mask length: {}. Mask length must be <= {}",
+ std::max(oneMask, twoMask),
kBitCount));
}
char str[sizeof("2001:0db8:0000:0000:0000:ff00:0042:8329")];
out.append(str, fastIpv6ToBufferUnsafe(in6Addr, str));
}
-}
-}
+} // namespace detail
+} // namespace folly