From 581791b3e0dce9b1d2d773f94f868be166c53735 Mon Sep 17 00:00:00 2001 From: Phil Willoughby Date: Fri, 27 Jan 2017 06:43:33 -0800 Subject: [PATCH] Namespace rename from UpperCamelCase to snake_case Summary: `folly::literals` is to `folly` what `std::literals` is to `std`. More importantly we should be consitent; snake_case is how other folly sub-namespaces are named, such as: `array_detail` `apply_tuple` `format_value` `threadlocal_detail` `recordio_helpers` `exception_tracer` Reviewed By: ericniebler Differential Revision: D4468281 fbshipit-source-id: de10bec74c9a38f387d62bd55da947291c23970b --- folly/FixedString.h | 10 +++++----- folly/test/FixedStringTest.cpp | 4 ++-- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/folly/FixedString.h b/folly/FixedString.h index 4f2f1000..f30ee507 100644 --- a/folly/FixedString.h +++ b/folly/FixedString.h @@ -502,7 +502,7 @@ std::uint32_t hsieh_hash32_buf(const void* buf, std::size_t len); * of types `FixedString<4>`, `FixedString<8>`, etc. For example: * \par * \code - * using namespace folly::StringLiterals; + * using namespace folly::string_literals; * constexpr auto hello = "hello"_fs8; // A FixedString<8> containing "hello" * \endcode * \par @@ -514,7 +514,7 @@ std::uint32_t hsieh_hash32_buf(const void* buf, std::size_t len); * the right size. For example: * \par * \code - * using namespace folly::StringLiterals; + * using namespace folly::string_literals; * // NOTE: Only works on compilers with GNU extensions enabled. Clang and * // gcc support this (-Wgnu-string-literal-operator-template): * constexpr auto hello = "hello"_fs; // A FixedString<5> containing "hello" @@ -2894,8 +2894,8 @@ FOLLY_CPP14_CONSTEXPR void swap( a.swap(b); } -inline namespace Literals { -inline namespace StringLiterals { +inline namespace literals { +inline namespace string_literals { inline namespace { // "const std::size_t&" is so that folly::npos has the same address in every // translation unit. This is to avoid potential violations of the ODR. @@ -2914,7 +2914,7 @@ constexpr const std::size_t& npos = detail::fixedstring::FixedStringBase::npos; * \par Example: * \par * \code - * using namespace folly::StringLiterals; + * using namespace folly::string_literals; * constexpr auto hello = "hello world!"_fs; * \endcode * diff --git a/folly/test/FixedStringTest.cpp b/folly/test/FixedStringTest.cpp index 3245aaa4..c0b019be 100644 --- a/folly/test/FixedStringTest.cpp +++ b/folly/test/FixedStringTest.cpp @@ -21,7 +21,7 @@ #include #define FS(x) ::folly::makeFixedString(x) -using namespace folly::StringLiterals; +using namespace folly::string_literals; TEST(FixedStringExamples, Examples) { // Example from the docs: @@ -117,7 +117,7 @@ TEST(FixedStringCtorTest, FromInitializerList) { } TEST(FixedStringCtorTest, FromUDL) { - using namespace folly::Literals; + using namespace folly::literals; #if defined(__GNUC__) constexpr auto x = "hello"_fs; static_assert( -- 2.34.1