Consistent indentation for class visibility labels
authorYedidya Feldblum <yfeldblum@fb.com>
Sun, 30 Jul 2017 03:09:05 +0000 (20:09 -0700)
committerFacebook Github Bot <facebook-github-bot@users.noreply.github.com>
Sun, 30 Jul 2017 03:28:11 +0000 (20:28 -0700)
Summary: [Folly] Consistent indentation for class visibility labels (`public:`, `protected:`, `private:`). Style is +1 column relative to the `class` keyword.

Reviewed By: andrewjcg

Differential Revision: D5524869

fbshipit-source-id: 53e4b6cbda10d5b63bafbd535794a8b7ae01a8e0

45 files changed:
folly/AtomicHashArray.h
folly/FBString.h
folly/FBVector.h
folly/Foreach.h
folly/Hash.h
folly/Lazy.h
folly/Memory.h
folly/PackedSyncPtr.h
folly/ProducerConsumerQueue.h
folly/Range.h
folly/detail/Sleeper.h
folly/dynamic-inl.h
folly/dynamic.h
folly/experimental/DynamicParser-inl.h
folly/experimental/DynamicParser.h
folly/experimental/LockFreeRingBuffer.h
folly/experimental/StringKeyedMap.h
folly/experimental/StringKeyedSet.h
folly/experimental/StringKeyedUnorderedMap.h
folly/experimental/StringKeyedUnorderedSet.h
folly/experimental/TestUtil.h
folly/experimental/test/StringKeyedTest.cpp
folly/futures/SharedPromise.h
folly/futures/detail/FSM.h
folly/futures/test/ThenCompileTest.h
folly/gen/Base.h
folly/gen/Combine-inl.h
folly/gen/Core-inl.h
folly/gen/ParallelMap-inl.h
folly/io/async/AsyncServerSocket.h
folly/io/async/AsyncTimeout.h
folly/io/async/test/AsyncSSLSocketTest.h
folly/io/async/test/EventBaseTest.cpp
folly/io/async/test/EventHandlerTest.cpp
folly/io/async/test/MockAsyncServerSocket.h
folly/json.cpp
folly/small_vector.h
folly/sorted_vector_types.h
folly/test/ApplyTupleTest.cpp
folly/test/ArenaSmartPtrTest.cpp
folly/test/AtomicHashMapTest.cpp
folly/test/ContainerTraitsTest.cpp
folly/test/OptionalTest.cpp
folly/test/ScopeGuardTest.cpp
folly/test/stl_tests/StlVectorTest.cpp

index 7dce3a0eb158822898132a45ddce7cdab31ec6dc..3e151afc00f383cbaa22610025b1166719ebf2e0 100644 (file)
@@ -179,7 +179,6 @@ class AtomicHashArray : boost::noncopyable {
     uint32_t entryCountThreadCacheSize;
     size_t capacity; // if positive, overrides maxLoadFactor
 
-  public:
     //  Cannot have constexpr ctor because some compilers rightly complain.
     Config() : emptyKey((KeyT)-1),
                lockedKey((KeyT)-2),
index b36bb948f04d9b5927cd79c56b65c30d8426ebc2..a22dee196909cc406a0df78ecde36d8d86a7a286 100644 (file)
@@ -231,7 +231,7 @@ enum class AcquireMallocatedString {};
 
 template <class Char>
 class fbstring_core_model {
-public:
+ public:
   fbstring_core_model();
   fbstring_core_model(const fbstring_core_model &);
   ~fbstring_core_model();
@@ -280,7 +280,7 @@ public:
   // the string without reallocation. For reference-counted strings,
   // it should fork the data even if minCapacity < size().
   void reserve(size_t minCapacity);
-private:
+ private:
   // Do not implement
   fbstring_core_model& operator=(const fbstring_core_model &);
 };
@@ -313,7 +313,7 @@ private:
  * to extract capacity/category.
  */
 template <class Char> class fbstring_core {
-protected:
+ protected:
 // It's MSVC, so we just have to guess ... and allow an override
 #ifdef _MSC_VER
 # ifdef FOLLY_ENDIAN_BE
@@ -325,7 +325,7 @@ protected:
   static constexpr auto kIsLittleEndian =
       __BYTE_ORDER__ == __ORDER_LITTLE_ENDIAN__;
 #endif
-public:
+ public:
   fbstring_core() noexcept { reset(); }
 
   fbstring_core(const fbstring_core & rhs) {
@@ -512,7 +512,7 @@ public:
     return category() == Category::isLarge && RefCounted::refs(ml_.data_) > 1;
   }
 
-private:
+ private:
   // Disabled
   fbstring_core & operator=(const fbstring_core & rhs);
 
@@ -989,7 +989,7 @@ inline void fbstring_core<Char>::shrinkLarge(const size_t delta) {
  */
 template <class Char>
 class dummy_fbstring_core {
-public:
+ public:
   dummy_fbstring_core() {
   }
   dummy_fbstring_core(const dummy_fbstring_core& another)
@@ -1032,7 +1032,7 @@ public:
     backend_.reserve(minCapacity);
   }
 
-private:
+ private:
   std::basic_string<Char> backend_;
 };
 #endif // !_LIBSTDCXX_FBSTRING
@@ -1113,7 +1113,7 @@ class basic_fbstring {
   static constexpr size_type npos = size_type(-1);
   typedef std::true_type IsRelocatable;
 
-private:
+ private:
   static void procrustes(size_type& n, size_type nmax) {
     if (n > nmax) {
       n = nmax;
@@ -1122,7 +1122,7 @@ private:
 
   static size_type traitsLength(const value_type* s);
 
-public:
+ public:
   // C++11 21.4.2 construct/copy/destroy
 
   // Note: while the following two constructors can be (and previously were)
@@ -1495,29 +1495,29 @@ public:
   }
 #endif
 
-private:
- iterator
- insertImplDiscr(const_iterator i, size_type n, value_type c, std::true_type);
-
- template <class InputIter>
- iterator
- insertImplDiscr(const_iterator i, InputIter b, InputIter e, std::false_type);
-
- template <class FwdIterator>
- iterator insertImpl(
-     const_iterator i,
-     FwdIterator s1,
-     FwdIterator s2,
-     std::forward_iterator_tag);
-
- template <class InputIterator>
- iterator insertImpl(
-     const_iterator i,
-     InputIterator b,
-     InputIterator e,
-     std::input_iterator_tag);
-
-public:
+ private:
 iterator
 insertImplDiscr(const_iterator i, size_type n, value_type c, std::true_type);
+
 template <class InputIter>
 iterator
 insertImplDiscr(const_iterator i, InputIter b, InputIter e, std::false_type);
+
 template <class FwdIterator>
 iterator insertImpl(
+      const_iterator i,
+      FwdIterator s1,
+      FwdIterator s2,
+      std::forward_iterator_tag);
+
 template <class InputIterator>
 iterator insertImpl(
+      const_iterator i,
+      InputIterator b,
+      InputIterator e,
+      std::input_iterator_tag);
+
+ public:
   template <class ItOrLength, class ItOrChar>
   iterator insert(const_iterator p, ItOrLength first_or_n, ItOrChar last_or_c) {
     using Sel = std::integral_constant<
@@ -1601,36 +1601,37 @@ public:
     return replace(i1, i2, s, traitsLength(s));
   }
 
-private:
- basic_fbstring& replaceImplDiscr(
-     iterator i1,
-     iterator i2,
-     const value_type* s,
-     size_type n,
-     std::integral_constant<int, 2>);
-
- basic_fbstring& replaceImplDiscr(
-     iterator i1,
-     iterator i2,
-     size_type n2,
-     value_type c,
-     std::integral_constant<int, 1>);
-
- template <class InputIter>
- basic_fbstring& replaceImplDiscr(
-     iterator i1,
-     iterator i2,
-     InputIter b,
-     InputIter e,
-     std::integral_constant<int, 0>);
-
-private:
- template <class FwdIterator>
- bool replaceAliased(iterator /* i1 */,
-                     iterator /* i2 */,
-                     FwdIterator /* s1 */,
-                     FwdIterator /* s2 */,
-                     std::false_type) {
+ private:
+  basic_fbstring& replaceImplDiscr(
+      iterator i1,
+      iterator i2,
+      const value_type* s,
+      size_type n,
+      std::integral_constant<int, 2>);
+
+  basic_fbstring& replaceImplDiscr(
+      iterator i1,
+      iterator i2,
+      size_type n2,
+      value_type c,
+      std::integral_constant<int, 1>);
+
+  template <class InputIter>
+  basic_fbstring& replaceImplDiscr(
+      iterator i1,
+      iterator i2,
+      InputIter b,
+      InputIter e,
+      std::integral_constant<int, 0>);
+
+ private:
+  template <class FwdIterator>
+  bool replaceAliased(
+      iterator /* i1 */,
+      iterator /* i2 */,
+      FwdIterator /* s1 */,
+      FwdIterator /* s2 */,
+      std::false_type) {
     return false;
   }
 
@@ -1842,7 +1843,7 @@ private:
     return r != 0 ? r : n1 > n2 ? 1 : n1 < n2 ? -1 : 0;
   }
 
-private:
+ private:
   // Data
   Storage store_;
 };
index 4a792af025d2e6dfbb1f7442218c3bb9537422d2..0acac2347331265dae1a35d8919f2bb5ac5c41ae 100644 (file)
@@ -77,8 +77,7 @@ class fbvector {
   //===========================================================================
   //---------------------------------------------------------------------------
   // implementation
-private:
-
+ private:
   typedef std::allocator_traits<Allocator> A;
 
   struct Impl : public Allocator {
@@ -192,8 +191,7 @@ private:
   //===========================================================================
   //---------------------------------------------------------------------------
   // types and constants
-public:
-
+ public:
   typedef T                                           value_type;
   typedef value_type&                                 reference;
   typedef const value_type&                           const_reference;
@@ -207,8 +205,7 @@ public:
   typedef std::reverse_iterator<iterator>             reverse_iterator;
   typedef std::reverse_iterator<const_iterator>       const_reverse_iterator;
 
-private:
-
+ private:
   typedef std::integral_constant<bool,
       IsTriviallyCopyable<T>::value &&
       sizeof(T) <= 16 // don't force large structures to be passed by value
@@ -227,8 +224,7 @@ private:
   //===========================================================================
   //---------------------------------------------------------------------------
   // allocator helpers
-private:
-
+ private:
   //---------------------------------------------------------------------------
   // allocate
 
@@ -332,8 +328,7 @@ private:
   //===========================================================================
   //---------------------------------------------------------------------------
   // algorithmic helpers
-private:
-
+ private:
   //---------------------------------------------------------------------------
   // destroy_range
 
@@ -582,8 +577,7 @@ private:
   //===========================================================================
   //---------------------------------------------------------------------------
   // relocation helpers
-private:
-
+ private:
   // Relocation is divided into three parts:
   //
   //  1: relocate_move
@@ -689,8 +683,7 @@ private:
   //===========================================================================
   //---------------------------------------------------------------------------
   // construct/copy/destroy
-public:
-
+ public:
   fbvector() = default;
 
   explicit fbvector(const Allocator& a) : impl_(a) {}
@@ -794,8 +787,7 @@ public:
     return impl_;
   }
 
-private:
-
+ private:
   // contract dispatch for iterator types fbvector(It first, It last)
   template <class ForwardIterator>
   fbvector(ForwardIterator first, ForwardIterator last,
@@ -868,8 +860,7 @@ private:
   //===========================================================================
   //---------------------------------------------------------------------------
   // iterators
-public:
-
+ public:
   iterator begin() noexcept {
     return impl_.b_;
   }
@@ -911,8 +902,7 @@ public:
   //===========================================================================
   //---------------------------------------------------------------------------
   // capacity
-public:
-
+ public:
   size_type size() const noexcept {
     return size_type(impl_.e_ - impl_.b_);
   }
@@ -1011,8 +1001,7 @@ public:
     }
   }
 
-private:
-
+ private:
   bool reserve_in_place(size_type n) {
     if (!usingStdAllocator::value || !usingJEMalloc()) return false;
 
@@ -1032,8 +1021,7 @@ private:
   //===========================================================================
   //---------------------------------------------------------------------------
   // element access
-public:
-
+ public:
   reference operator[](size_type n) {
     assert(n < size());
     return impl_.b_[n];
@@ -1072,8 +1060,7 @@ public:
   //===========================================================================
   //---------------------------------------------------------------------------
   // data access
-public:
-
+ public:
   T* data() noexcept {
     return impl_.b_;
   }
@@ -1084,8 +1071,7 @@ public:
   //===========================================================================
   //---------------------------------------------------------------------------
   // modifiers (common)
-public:
-
+ public:
   template <class... Args>
   void emplace_back(Args&&... args)  {
     if (impl_.e_ != impl_.z_) {
@@ -1133,8 +1119,7 @@ public:
     M_destroy_range_e(impl_.b_);
   }
 
-private:
-
+ private:
   // std::vector implements a similar function with a different growth
   //  strategy: empty() ? 1 : capacity() * 2.
   //
@@ -1172,8 +1157,7 @@ private:
   //===========================================================================
   //---------------------------------------------------------------------------
   // modifiers (erase)
-public:
-
+ public:
   iterator erase(const_iterator position) {
     return erase(position, position + 1);
   }
@@ -1207,8 +1191,7 @@ public:
   //===========================================================================
   //---------------------------------------------------------------------------
   // modifiers (insert)
-private: // we have the private section first because it defines some macros
-
+ private: // we have the private section first because it defines some macros
   bool isValid(const_iterator it) {
     return cbegin() <= it && it <= cend();
   }
@@ -1476,8 +1459,7 @@ private: // we have the private section first because it defines some macros
 
   //---------------------------------------------------------------------------
   // insert dispatch for iterator types
-private:
-
+ private:
   template <class FIt>
   iterator insert(const_iterator cpos, FIt first, FIt last,
                   std::forward_iterator_tag) {
@@ -1511,8 +1493,7 @@ private:
   //===========================================================================
   //---------------------------------------------------------------------------
   // lexicographical functions
-public:
-
+ public:
   bool operator==(const fbvector& other) const {
     return size() == other.size() && std::equal(begin(), end(), other.begin());
   }
@@ -1541,8 +1522,7 @@ public:
   //===========================================================================
   //---------------------------------------------------------------------------
   // friends
-private:
-
+ private:
   template <class _T, class _A>
   friend _T* relinquish(fbvector<_T, _A>&);
 
index 3ea9b3a43dbd7aa20f3c97d5e72eb3cfbfe5cf2b..51372ef21ec9a915c3e33fc34cbff125af827905 100644 (file)
@@ -120,7 +120,8 @@ class HasLess {
   struct BiggerThanChar { char unused[2]; };
   template <typename C, typename D> static char test(decltype(C() < D())*);
   template <typename, typename> static BiggerThanChar test(...);
-public:
+
+ public:
   enum { value = sizeof(test<T, U>(0)) == 1 };
 };
 
index 78bb5f4819135f7aaf9eabf13a74552dc78c88a1..211dc44ed37838896036fca50a5f4e08cb98079d 100644 (file)
@@ -505,7 +505,7 @@ namespace std {
   // items in the pair.
   template <typename T1, typename T2>
   struct hash<std::pair<T1, T2> > {
-  public:
+   public:
     size_t operator()(const std::pair<T1, T2>& x) const {
       return folly::hash::hash_combine(x.first, x.second);
     }
index 963dd479a8889c7e01028cc18ea09c7a4e133a23..afab2faa830274cae31a31e866cdc7545955a455 100644 (file)
@@ -111,7 +111,7 @@ struct Lazy {
     return *value_;
   }
 
-private:
+ private:
   Optional<result_type> value_;
   Func func_;
 };
index 0ff1983f50c5d5cabe07004e1653d41d0a91011e..39b868c18058f499c73745d1a597a0e1e05c2809 100644 (file)
@@ -317,7 +317,7 @@ class allocator_delete
 {
   typedef typename std::remove_reference<Allocator>::type allocator_type;
 
-public:
+ public:
   typedef typename Allocator::pointer pointer;
 
   allocator_delete() = default;
@@ -356,7 +356,7 @@ class is_simple_allocator {
   typedef typename std::remove_reference<T>::type value_type;
   typedef value_type* pointer;
 
-public:
+ public:
   constexpr static bool value = !has_destroy<allocator, void(pointer)>::value
     && !has_destroy<allocator, void(void*)>::value;
 };
@@ -491,7 +491,7 @@ template <class T> struct IsArenaAllocator : std::false_type { };
  */
 template <typename T>
 class enable_shared_from_this : public std::enable_shared_from_this<T> {
-public:
+ public:
   constexpr enable_shared_from_this() noexcept = default;
 
   std::weak_ptr<T> weak_from_this() noexcept {
@@ -502,7 +502,7 @@ public:
     return weak_from_this_<T>(this);
   }
 
-private:
+ private:
   // Uses SFINAE to detect and call
   // std::enable_shared_from_this<T>::weak_from_this() if available. Falls
   // back to std::enable_shared_from_this<T>::shared_from_this() otherwise.
index f5f4eb9ee3595aa55e9910df75cbc30fc43c520f..44d3f5576390ff5d43ad6db2afe14b67abaae919 100644 (file)
@@ -66,7 +66,7 @@ class PackedSyncPtr {
   // still properly result in a compile error.
   typedef typename std::add_lvalue_reference<T>::type reference;
 
-public:
+ public:
   /*
    * If you default construct one of these, you must call this init()
    * function before using it.
index 13948be45218e374777a012ad392d8c59c44cb76..fd9c94a0dc3fd49edda24695cb16323be4580a77 100644 (file)
@@ -167,15 +167,15 @@ struct ProducerConsumerQueue {
     return ret;
   }
 
-private:
- char pad0_[CacheLocality::kFalseSharingRange];
- const uint32_t size_;
- T* const records_;
+ private:
 char pad0_[CacheLocality::kFalseSharingRange];
 const uint32_t size_;
 T* const records_;
 
- FOLLY_ALIGN_TO_AVOID_FALSE_SHARING std::atomic<unsigned int> readIndex_;
- FOLLY_ALIGN_TO_AVOID_FALSE_SHARING std::atomic<unsigned int> writeIndex_;
 FOLLY_ALIGN_TO_AVOID_FALSE_SHARING std::atomic<unsigned int> readIndex_;
 FOLLY_ALIGN_TO_AVOID_FALSE_SHARING std::atomic<unsigned int> writeIndex_;
 
- char pad1_[CacheLocality::kFalseSharingRange - sizeof(writeIndex_)];
 char pad1_[CacheLocality::kFalseSharingRange - sizeof(writeIndex_)];
 };
 
 }
index 3ccf8685a795557074babb04653423463e81fabb..aaf30af721e161351e7a0505375a77ff395c00dc 100644 (file)
@@ -163,7 +163,7 @@ struct IsCharPointer<const char*> {
  */
 template <class Iter>
 class Range : private boost::totally_ordered<Range<Iter> > {
-public:
+ public:
   typedef std::size_t size_type;
   typedef Iter iterator;
   typedef Iter const_iterator;
@@ -197,7 +197,7 @@ public:
   constexpr Range(const Range&) = default;
   constexpr Range(Range&&) = default;
 
-public:
+ public:
   // Works for all iterators
   constexpr Range(Iter start, Iter end) : b_(start), e_(end) {
   }
@@ -923,7 +923,7 @@ public:
     -> decltype(process(std::declval<Range>(), std::forward<Args>(args)...))
   { return process(split_step(delimiter), std::forward<Args>(args)...); }
 
-private:
+ private:
   Iter b_, e_;
 };
 
index 703d065ba7b2a5ec5259ab16662262dcafff8aa8..c2efad002098bbf1e018edd5f83e1f094a538af7 100644 (file)
@@ -41,7 +41,7 @@ namespace detail {
 
     uint32_t spinCount;
 
-  public:
+   public:
     Sleeper() : spinCount(0) {}
 
     void wait() {
index 210dd0e335b9545506edb1879e63e667ecaf61fa..ea8552cbf0468642e1969ac2302a29a9dbb6c4a1 100644 (file)
@@ -167,7 +167,7 @@ struct dynamic::ObjectMaker {
     return std::move(*this);
   }
 
-private:
+ private:
   dynamic val_;
 };
 
index b099df3e0afeda17fd88279a57d1ea6b85f023c7..bab21a59f742fa3bc9f3c74f21967ff8e79f79a4 100644 (file)
@@ -96,9 +96,10 @@ struct dynamic : private boost::operators<dynamic> {
    * Object value iterators dereference as the values in the object.
    * Object item iterators dereference as pairs of (key, value).
    */
-private:
+ private:
   typedef std::vector<dynamic> Array;
-public:
+
+ public:
   typedef Array::iterator iterator;
   typedef Array::const_iterator const_iterator;
   typedef dynamic value_type;
@@ -129,11 +130,11 @@ public:
    *   d["key"] = 12;
    *   d["something_else"] = dynamic::array(1, 2, 3, nullptr);
    */
-private:
+ private:
   struct EmptyArrayTag {};
   struct ObjectMaker;
 
-public:
+ public:
   static void array(EmptyArrayTag);
   template <class... Args>
   static dynamic array(Args&& ...args);
@@ -328,13 +329,13 @@ public:
   iterator begin();
   iterator end();
 
-private:
+ private:
   /*
    * Helper object returned by keys(), values(), and items().
    */
   template <class T> struct IterableProxy;
 
-public:
+ public:
   /*
    * You can iterate over the keys, values, or items (std::pair of key and
    * value) in an object.  Calling these on non-objects will throw a TypeError.
@@ -521,7 +522,7 @@ public:
    */
   std::size_t hash() const;
 
-private:
+ private:
   friend struct TypeError;
   struct ObjectImpl;
   template <class T> struct TypeInfo;
@@ -546,7 +547,7 @@ private:
   void print(std::ostream&) const;
   void print_as_pseudo_json(std::ostream&) const; // see json.cpp
 
-private:
+ private:
   Type type_;
   union Data {
     explicit Data() : nul(nullptr) {}
index 106b8f96a9daa85aef04c075adf39646df0a7b92..c4b726b1ee191d5f785448cb0133ac39cabba54f 100644 (file)
@@ -39,11 +39,12 @@ namespace folly {
 // DynamicParser.h.
 namespace detail {
 class IdentifyCallable {
-public:
+ public:
   enum class Kind { Function, MemberFunction };
   template <typename Fn>
   constexpr static Kind getKind() { return test<Fn>(nullptr); }
-private:
+
+ private:
   template <typename Fn>
   using IsMemFn = typename boost::function_types::template is_member_pointer<
     decltype(&Fn::operator())
index 3994eb64199d1097775782e6fc846e6aff448bb2..c84597ff82a843ca0117abd01c06d0ca726500c9 100644 (file)
@@ -207,7 +207,8 @@ struct DynamicParserParseError : public std::runtime_error {
    *   {"nested": {"key1": {"key_errors": {"key3": "err"}, "value": 7}}}
    */
   const folly::dynamic& error() const { return error_; }
-private:
+
+ private:
   folly::dynamic error_;
 };
 
@@ -223,7 +224,7 @@ struct DynamicParserLogicError : public std::logic_error {
 };
 
 class DynamicParser {
-public:
+ public:
   enum class OnError {
     // After parsing, releaseErrors() reports all parse errors.
     // Throws DynamicParserLogicError on programmer errors.
@@ -294,7 +295,7 @@ public:
     return *this;
   }
 
-private:
+ private:
   /**
    * If `fn` throws an exception, wrapError() catches it and inserts an
    * enriched description into stack_.errors_.  If lookup_key is non-null,
@@ -321,7 +322,7 @@ private:
       explicit Pop(ParserStack* sp)
         : key_(sp->key_), value_(sp->value_), stackPtr_(sp) {}
       void operator()() noexcept;  // ScopeGuard requires noexcept
-    private:
+     private:
       const folly::dynamic* key_;
       const folly::dynamic* value_;
       ParserStack* stackPtr_;
index f863c2d2c6a62413b693af1d0244a3d24e577a4d..abc5f1230c928d30ad57c549e5e63897ef533277 100644 (file)
@@ -57,14 +57,15 @@ class RingBufferSlot;
 
 template <typename T, template <typename> class Atom = std::atomic>
 class LockFreeRingBuffer: boost::noncopyable {
+  static_assert(
+      std::is_nothrow_default_constructible<T>::value,
+      "Element type must be nothrow default constructible");
 
-   static_assert(std::is_nothrow_default_constructible<T>::value,
-       "Element type must be nothrow default constructible");
+  static_assert(
+      FOLLY_IS_TRIVIALLY_COPYABLE(T),
+      "Element type must be trivially copyable");
 
-   static_assert(FOLLY_IS_TRIVIALLY_COPYABLE(T),
-       "Element type must be trivially copyable");
-
-public:
+ public:
   /// Opaque pointer to a past or future write.
   /// Can be moved relative to its current location but not in absolute terms.
   struct Cursor {
@@ -90,7 +91,7 @@ public:
       return prevTicket != ticket;
     }
 
-  protected: // for test visibility reasons
+   protected: // for test visibility reasons
     uint64_t ticket;
     friend class LockFreeRingBuffer;
   };
@@ -162,7 +163,7 @@ public:
   ~LockFreeRingBuffer() {
   }
 
-private:
+ private:
   const uint32_t capacity_;
 
   const std::unique_ptr<detail::RingBufferSlot<T,Atom>[]> slots_;
@@ -181,7 +182,7 @@ private:
 namespace detail {
 template <typename T, template <typename> class Atom>
 class RingBufferSlot {
-public:
+ public:
   explicit RingBufferSlot() noexcept
     : sequencer_()
     , data()
@@ -224,8 +225,7 @@ public:
     return sequencer_.isTurn((turn + 1) * 2);
   }
 
-
-private:
+ private:
   TurnSequencer<Atom> sequencer_;
   T data;
 }; // RingBufferSlot
index 4164cde4c4d31fec2a6897453513f75ff042ddcc..b6479993d4494bc358d22ffc7f237aef20bb9554 100644 (file)
@@ -39,10 +39,10 @@ template <class Value,
           class Alloc = std::allocator<std::pair<const StringPiece, Value>>>
 class StringKeyedMap
     : private std::map<StringPiece, Value, Compare, Alloc> {
-private:
+ private:
   using Base = std::map<StringPiece, Value, Compare, Alloc>;
 
-public:
+ public:
   typedef typename Base::key_type key_type;
   typedef typename Base::mapped_type mapped_type;
   typedef typename Base::value_type value_type;
index 699124dd2bc07859fa9cfc98730da57199aa5564..805e53146ba1bdce55545156c223e36ed5bfda41 100644 (file)
@@ -38,10 +38,10 @@ template <class Compare = std::less<StringPiece>,
           class Alloc = std::allocator<StringPiece>>
 class StringKeyedSetBase
     : private std::set<StringPiece, Compare, Alloc> {
-private:
+ private:
   using Base = std::set<StringPiece, Compare, Alloc>;
 
-public:
+ public:
   typedef typename Base::key_type key_type;
   typedef typename Base::value_type value_type;
   typedef typename Base::key_compare key_compare;
index 7099332ab3fc66207e79481b36d7b3df6f5186c0..9acf92cd3cf3d21c6f787b28cc24c542818e0bd2 100644 (file)
@@ -47,7 +47,7 @@ class StringKeyedUnorderedMap
  private:
   using Base = std::unordered_map<StringPiece, Value, Hash, Eq, Alloc>;
 
-public:
+ public:
   typedef typename Base::key_type key_type;
   typedef typename Base::mapped_type mapped_type;
   typedef typename Base::value_type value_type;
index 0956bacf807fe2a6a60d0bde03ea663284223ef5..4fc1b71032ac4dbd7881b686e202b7d3fccf1240 100644 (file)
@@ -45,7 +45,7 @@ class BasicStringKeyedUnorderedSet
     : private std::unordered_set<StringPiece, Hasher, Eq, Alloc> {
   using Base = std::unordered_set<StringPiece, Hasher, Eq, Alloc>;
 
-public:
+ public:
   typedef typename Base::key_type key_type;
   typedef typename Base::value_type value_type;
   typedef typename Base::hasher hasher;
index 2460b84bc40d1dfd051d76476f2aecd9d52f1743..a02a1a874e267bb627b5c650314eae68dea4e4e0 100644 (file)
@@ -106,7 +106,7 @@ class TemporaryDirectory {
  * upon destruction, also changing back to the original working directory.
  */
 class ChangeToTempDir {
-public:
+ public:
   ChangeToTempDir();
   ~ChangeToTempDir();
 
@@ -116,7 +116,7 @@ public:
 
   const fs::path& path() const { return dir_.path(); }
 
-private:
+ private:
   fs::path initialPath_;
   TemporaryDirectory dir_;
 };
@@ -193,9 +193,10 @@ inline std::string glogErrOrWarnPattern() { return ".*(^|\n)[EW][0-9].*"; }
  * Great for testing logging (see also glog*Pattern()).
  */
 class CaptureFD {
-private:
+ private:
   struct NoOpChunkCob { void operator()(StringPiece) {} };
-public:
+
+ public:
   using ChunkCob = std::function<void(folly::StringPiece)>;
 
   /**
@@ -224,7 +225,7 @@ public:
    */
   std::string readIncremental();
 
-private:
+ private:
   ChunkCob chunkCob_;
   TemporaryFile file_;
 
index 1a9a6c41384c3329e88c07d9cb291010a1c10828..b67444598e62c1f630cf75dadff06358abdb5515 100644 (file)
@@ -106,7 +106,7 @@ struct MemoryLeakCheckerAllocator {
     return alloc_ == other.alloc_;
   }
 
-private:
+ private:
   Alloc alloc_;
 };
 
index 2e466b1aa6e8940ff2e38e592918c258e55f746d..44987eaf02f82f24be51f40d41d266c74cc716be 100644 (file)
@@ -34,7 +34,7 @@ namespace folly {
  */
 template <class T>
 class SharedPromise {
-public:
+ public:
   SharedPromise() = default;
   ~SharedPromise() = default;
 
@@ -107,7 +107,7 @@ public:
 
   bool isFulfilled();
 
-private:
+ private:
   std::mutex mutex_;
   size_t size_{0};
   bool hasValue_{false};
index 9916a91869b67141072d3c8f06185f967032da83..41d652b85cc8bc6fa0e73412a394f1e7887c67bf 100644 (file)
@@ -30,7 +30,7 @@ namespace detail {
 /// For best results, use an "enum class" for Enum.
 template <class Enum>
 class FSM {
-private:
+ private:
   // I am not templatizing this because folly::MicroSpinLock needs to be
   // zero-initialized (or call init) which isn't generic enough for something
   // that behaves like std::mutex. :(
@@ -43,7 +43,7 @@ private:
   // An optimization would be to use a static conditional on the Enum type.
   std::atomic<Enum> state_;
 
-public:
+ public:
   explicit FSM(Enum startState) : state_(startState) {}
 
   Enum getState() const noexcept {
index aff9ff68e7d7824196871e41dd3ca49d05decaf2..886e73345e810a488f258c2a10c909538c311a3d 100644 (file)
@@ -65,7 +65,7 @@ aStdFunction(typename std::enable_if<isFuture<Ret>::value, bool>::type = true) {
 }
 
 class SomeClass {
-public:
+ public:
   template <class Ret, class... Params>
   static
   typename std::enable_if<!isFuture<Ret>::value, Ret>::type
index 279ec0d21510fbfddb8e0c6dd8fb01f2af4a585a..fbc224cf31c2bad4f2e0c2a9c6e07cc87f3f5e70 100644 (file)
@@ -84,7 +84,7 @@ namespace folly {
 namespace gen {
 
 class Less {
-public:
+ public:
   template <class First, class Second>
   auto operator()(const First& first, const Second& second) const ->
   decltype(first < second) {
@@ -93,7 +93,7 @@ public:
 };
 
 class Greater {
-public:
+ public:
   template <class First, class Second>
   auto operator()(const First& first, const Second& second) const ->
   decltype(first > second) {
@@ -103,7 +103,7 @@ public:
 
 template <int n>
 class Get {
-public:
+ public:
   template <class Value>
   auto operator()(Value&& value) const ->
   decltype(std::get<n>(std::forward<Value>(value))) {
@@ -188,7 +188,7 @@ class Field {
 };
 
 class Move {
-public:
+ public:
   template <class Value>
   auto operator()(Value&& value) const ->
   decltype(std::move(std::forward<Value>(value))) {
index a1deb861ce6b08824dfd7aa86bf1244b41ca4ae8..2504896457894e6dbb911ee99bbb02efda0a39a8 100644 (file)
@@ -49,7 +49,8 @@ class Interleave : public Operator<Interleave<Container>> {
 
     static_assert(std::is_same<const Value&, ConstRefType>::value,
                   "Only matching types may be interleaved");
-  public:
+
+   public:
     explicit Generator(Source source,
                        const std::shared_ptr<const Container> container)
       : source_(std::move(source)),
@@ -111,7 +112,8 @@ class Zip : public Operator<Zip<Container>> {
                                    Generator<Value1,Source,Value2,Result>> {
     Source source_;
     const std::shared_ptr<const Container> container_;
-  public:
+
+   public:
     explicit Generator(Source source,
                        const std::shared_ptr<const Container> container)
       : source_(std::move(source)),
index 1097d13cc9b1213fbc8cee91b20316b564db696b..3d6c988dc20b18de368be040a7ade71c0bf53001 100644 (file)
@@ -57,7 +57,8 @@ class IsCompatibleSignature<Candidate, ExpectedReturn(ArgTypes...)> {
   static constexpr bool testArgs(...) {
     return false;
   }
-public:
+
+ public:
   static constexpr bool value = testArgs<Candidate>(nullptr);
 };
 
@@ -351,7 +352,8 @@ class Chain : public GenImpl<Value,
                              Chain<Value, First, Second>> {
   First first_;
   Second second_;
-public:
+
+ public:
   explicit Chain(First first, Second second)
       : first_(std::move(first))
       , second_(std::move(second)) {}
index 22063113023e27744c67a1fe0f7934fe936bd794..906ce88a75e004ae3bd6a1c1d08f9104b129ac10 100644 (file)
@@ -146,7 +146,7 @@ class PMap : public Operator<PMap<Predicate>> {
       }
     };
 
-  public:
+   public:
     Generator(Source source, const Predicate& pred, size_t nThreads)
       : source_(std::move(source)),
         pred_(pred),
index 1d53bccc784b7482558f837260427b7bae456bbf..f7706126e06fd0446f37add63f6710878c452341 100644 (file)
@@ -746,7 +746,7 @@ class AsyncServerSocket : public DelayedDestruction
    */
   class RemoteAcceptor
       : private NotificationQueue<QueueMessage>::Consumer {
-  public:
+   public:
     explicit RemoteAcceptor(AcceptCallback *callback,
                             ConnectionEventCallback *connectionEventCallback)
       : callback_(callback),
@@ -763,7 +763,7 @@ class AsyncServerSocket : public DelayedDestruction
       return &queue_;
     }
 
-  private:
+   private:
     AcceptCallback *callback_;
     ConnectionEventCallback* connectionEventCallback_;
 
index 2f626d840c015e33c1a490f9fc1f29825154b840..bb02efb2b8a1de95a2d013dc6fe131f11fe8a7a9 100644 (file)
@@ -256,7 +256,7 @@ struct async_timeout_wrapper:
     callback_();
   }
 
-private:
+ private:
   TCallback callback_;
 };
 
index 3e400804659d2410eeeaacb2811dcaa04a61f57b..452d605e6dddcb45b83747f7c7854f19acea8372 100644 (file)
@@ -126,7 +126,7 @@ class SendMsgDataCallback : public SendMsgFlagsCallback {
 
 class WriteCallbackBase :
 public AsyncTransportWrapper::WriteCallback {
-public:
+ public:
   explicit WriteCallbackBase(SendMsgParamsCallbackBase* mcb = nullptr)
       : state(STATE_WAITING)
       , bytesWritten(0)
@@ -171,7 +171,7 @@ public:
 
 class ExpectWriteErrorCallback :
 public WriteCallbackBase {
-public:
+ public:
   explicit ExpectWriteErrorCallback(SendMsgParamsCallbackBase* mcb = nullptr)
       : WriteCallbackBase(mcb) {}
 
@@ -198,8 +198,8 @@ enum SOF_TIMESTAMPING {
 };
 
 class WriteCheckTimestampCallback :
- public WriteCallbackBase {
-public:
 public WriteCallbackBase {
+ public:
   explicit WriteCheckTimestampCallback(SendMsgParamsCallbackBase* mcb = nullptr)
     : WriteCallbackBase(mcb) {}
 
@@ -318,7 +318,7 @@ public AsyncTransportWrapper::ReadCallback {
 };
 
 class ReadCallback : public ReadCallbackBase {
-public:
+ public:
   explicit ReadCallback(WriteCallbackBase *wcb)
       : ReadCallbackBase(wcb)
       , buffers() {}
@@ -356,7 +356,7 @@ public:
   }
 
   class Buffer {
-  public:
+   public:
     Buffer() : buffer(nullptr), length(0) {}
     Buffer(char* buf, size_t len) : buffer(buf), length(len) {}
 
@@ -383,7 +383,7 @@ public:
 };
 
 class ReadErrorCallback : public ReadCallbackBase {
-public:
+ public:
   explicit ReadErrorCallback(WriteCallbackBase *wcb)
       : ReadCallbackBase(wcb) {}
 
@@ -428,7 +428,7 @@ class ReadEOFCallback : public ReadCallbackBase {
 };
 
 class WriteErrorCallback : public ReadCallback {
-public:
+ public:
   explicit WriteErrorCallback(WriteCallbackBase *wcb)
       : ReadCallback(wcb) {}
 
@@ -464,7 +464,7 @@ public:
 };
 
 class EmptyReadCallback : public ReadCallback {
-public:
+ public:
   explicit EmptyReadCallback()
       : ReadCallback(nullptr) {}
 
@@ -489,7 +489,7 @@ public:
 
 class HandshakeCallback :
 public AsyncSSLSocket::HandshakeCB {
-public:
+ public:
   enum ExpectType {
     EXPECT_SUCCESS,
     EXPECT_ERROR
@@ -562,7 +562,7 @@ public:
 };
 
 class SSLServerAcceptCallback: public SSLServerAcceptCallbackBase {
-public:
+ public:
   uint32_t timeout_;
 
   explicit SSLServerAcceptCallback(HandshakeCallback *hcb,
@@ -595,7 +595,7 @@ public:
 };
 
 class SSLServerAcceptCallbackDelay: public SSLServerAcceptCallback {
-public:
+ public:
   explicit SSLServerAcceptCallbackDelay(HandshakeCallback *hcb):
       SSLServerAcceptCallback(hcb) {}
 
@@ -636,7 +636,7 @@ public:
 };
 
 class SSLServerAsyncCacheAcceptCallback: public SSLServerAcceptCallback {
-public:
+ public:
   explicit SSLServerAsyncCacheAcceptCallback(HandshakeCallback *hcb,
                                              uint32_t timeout = 0):
     SSLServerAcceptCallback(hcb, timeout) {}
@@ -662,7 +662,7 @@ public:
 
 
 class HandshakeErrorCallback: public SSLServerAcceptCallbackBase {
-public:
+ public:
   explicit HandshakeErrorCallback(HandshakeCallback *hcb):
   SSLServerAcceptCallbackBase(hcb)  {}
 
@@ -698,7 +698,7 @@ public:
 };
 
 class HandshakeTimeoutCallback: public SSLServerAcceptCallbackBase {
-public:
+ public:
   explicit HandshakeTimeoutCallback(HandshakeCallback *hcb):
   SSLServerAcceptCallbackBase(hcb)  {}
 
index 4d07fabf8ac32da1bd06448715d47e94d801d907..1353976ee9bf80c305d3681d26b9063f98b0cce9 100644 (file)
@@ -1701,7 +1701,7 @@ TEST(EventBaseTest, RunBeforeLoopWait) {
 }
 
 class PipeHandler : public EventHandler {
-public:
+ public:
   PipeHandler(EventBase* eventBase, int fd)
     : EventHandler(eventBase, fd) {}
 
index c40fb71d9cedb6dedd1c8b16ddd07f8629a6614d..feb2f77414bd0c4aab1620b430033f04c5cb0691 100644 (file)
@@ -47,7 +47,7 @@ void runInThreadsAndWait(vector<function<void()>> cbs) {
 }
 
 class EventHandlerMock : public EventHandler {
-public:
+ public:
   EventHandlerMock(EventBase* eb, int fd) : EventHandler(eb, fd) {}
   // gmock can't mock noexcept methods, so we need an intermediary
   MOCK_METHOD1(_handlerReady, void(uint16_t));
@@ -57,7 +57,7 @@ public:
 };
 
 class EventHandlerTest : public Test {
-public:
+ public:
   int efd = 0;
 
   void SetUp() override {
index c75f1f38a4c11664a1c65df5f3350e6954a40e6d..30652601ee47149c0f0bd3ccf21d496e10f9a78f 100644 (file)
@@ -24,7 +24,7 @@ namespace folly {
 namespace test {
 
 class MockAsyncServerSocket : public AsyncServerSocket {
-public:
+ public:
   typedef std::unique_ptr<MockAsyncServerSocket, Destructor> UniquePtr;
 
   // We explicitly do not mock destroy(), since the base class implementation
index 07db1c330e9249a7864eabcc2204ecdc4269d549..03a2b52f38e9f78dc68879050f4f37481b838505 100644 (file)
@@ -85,7 +85,7 @@ struct Printer {
     }
   }
 
-private:
+ private:
   void printKV(const std::pair<const dynamic, dynamic>& p) const {
     if (!opts_.allow_non_string_keys && !p.first.isString()) {
       throw std::runtime_error("folly::toJson: JSON object key was not a "
@@ -156,7 +156,7 @@ private:
     out_ += ']';
   }
 
-private:
+ private:
   void outdent() const {
     if (indentLevel_) {
       --*indentLevel_;
@@ -179,10 +179,10 @@ private:
     out_ += indentLevel_ ? " : " : ":";
   }
 
-private:
- std::string& out_;
- unsigned* const indentLevel_;
- serialization_opts const& opts_;
+ private:
 std::string& out_;
 unsigned* const indentLevel_;
 serialization_opts const& opts_;
 };
 
 //////////////////////////////////////////////////////////////////////
@@ -319,7 +319,7 @@ struct Input {
     current_ = range_.empty() ? EOF : range_.front();
   }
 
-private:
+ private:
   StringPiece range_;
   json::serialization_opts const& opts_;
   unsigned lineNum_;
index 71893a3c387780186455b5a8aa351aacf3dcc6a9..0e148ef7928732a92f567b6040295b80eb7d0a87 100644 (file)
@@ -236,7 +236,7 @@ namespace detail {
 
     IntegralSizePolicy() : size_(0) {}
 
-  protected:
+   protected:
     static constexpr std::size_t policyMaxSize() {
       return SizeType(~kExternMask);
     }
@@ -266,10 +266,10 @@ namespace detail {
       std::swap(size_, o.size_);
     }
 
-  protected:
+   protected:
     static bool const kShouldUseHeap = ShouldUseHeap;
 
-  private:
+   private:
     static SizeType const kExternMask =
       kShouldUseHeap ? SizeType(1) << (sizeof(SizeType) * 8 - 1)
                      : 0;
@@ -826,8 +826,7 @@ class small_vector
     return (*this)[i];
   }
 
-private:
-
+ private:
   static iterator unconst(const_iterator it) {
     return const_cast<iterator>(it);
   }
@@ -1020,7 +1019,7 @@ private:
     }
   }
 
-private:
+ private:
   struct HeapPtrWithCapacity {
     void* heap_;
     InternalSizeType capacity_;
index 6d988efd47c29c9494c746070b1b881d52dab42f..7056ead2d2966c9d690ab90bf1f7c38cce83f83e 100644 (file)
@@ -213,7 +213,7 @@ class sorted_vector_set
   detail::growth_policy_wrapper<GrowthPolicy>&
   get_growth_policy() { return *this; }
 
-public:
+ public:
   typedef T       value_type;
   typedef T       key_type;
   typedef Compare key_compare;
@@ -403,7 +403,7 @@ public:
     return m_.cont_ < other.m_.cont_;
   }
 
-private:
+ private:
   /*
    * This structure derives from the comparison object in order to
    * make use of the empty base class optimization if our comparison
@@ -464,7 +464,7 @@ class sorted_vector_map
   detail::growth_policy_wrapper<GrowthPolicy>&
   get_growth_policy() { return *this; }
 
-public:
+ public:
   typedef Key                                       key_type;
   typedef Value                                     mapped_type;
   typedef std::pair<key_type,mapped_type>           value_type;
@@ -475,7 +475,7 @@ public:
       return Compare::operator()(a.first, b.first);
     }
 
-  protected:
+   protected:
     friend class sorted_vector_map;
     explicit value_compare(const Compare& c) : Compare(c) {}
   };
@@ -706,7 +706,7 @@ public:
     return m_.cont_ < other.m_.cont_;
   }
 
-private:
+ private:
   // This is to get the empty base optimization; see the comment in
   // sorted_vector_set.
   struct EBO : value_compare {
index fa9a575bd4723169219fd129b7acccd06a786e43..a09f80744ae64402fe0d28dfa95d3f0c9b5d7c53 100644 (file)
@@ -100,7 +100,7 @@ struct GuardObj : GuardObjBase {
   GuardObj(const GuardObj&) = delete;
   GuardObj& operator=(const GuardObj&) = delete;
 
-private:
+ private:
   F f_;
   Tuple args_;
 };
index 5dddd97e9c282dce9391dafbd60ed35c2cef64fb..911c3c37bc256e502d4b4c42697b57c49cd77fba 100644 (file)
@@ -40,7 +40,7 @@ struct global_counter {
 
   unsigned count() const { return count_; }
 
-private:
+ private:
   unsigned count_;
 };
 
@@ -55,7 +55,7 @@ struct Foo {
     counter_.decrease();
   }
 
-private:
+ private:
   global_counter& counter_;
 };
 
index ee2968db715a242081aa633ca8fab7e078592c9f..147d2238ef1a209b530fcc68bbf8a50b593ec0a3 100644 (file)
@@ -262,13 +262,13 @@ TEST(Ahm, iterator) {
 }
 
 class Counters {
-private:
+ private:
   // Note: Unfortunately can't currently put a std::atomic<int64_t> in
   // the value in ahm since it doesn't support types that are both non-copy
   // and non-move constructible yet.
   AtomicHashMap<int64_t,int64_t> ahm;
 
-public:
+ public:
   explicit Counters(size_t numCounters) : ahm(numCounters) {}
 
   void increment(int64_t obj_id) {
index f1f4090f61f648ef348096abda5e31bad639dbaa..14d27c3f2633d4a183980654bcea599db9a5917f 100644 (file)
@@ -30,7 +30,7 @@ struct Node {
 
 template <class T>
 class VectorWrapper {
-public:
+ public:
   using value_type = T;
   vector<T>& underlying;
   explicit VectorWrapper(vector<T>& v) : underlying(v) {}
index df1e5c4aecfcaac97762049b863e5a953d1cf270..365d8e41d4c7a9a944effaa8198fc071a31cb011 100644 (file)
@@ -111,7 +111,7 @@ TEST(Optional, Simple) {
 }
 
 class MoveTester {
-public:
+ public:
   /* implicit */ MoveTester(const char* s) : s_(s) {}
   MoveTester(const MoveTester&) = default;
   MoveTester(MoveTester&& other) noexcept {
@@ -124,7 +124,8 @@ public:
     other.s_ = "";
     return *this;
   }
-private:
+
+ private:
   friend bool operator==(const MoveTester& o1, const MoveTester& o2);
   std::string s_;
 };
index 7095df5f2044f967d014e4b2b36bb6864fa744e7..853c7b29aaa454ef62dffa209f88f3399271be9c 100644 (file)
@@ -228,7 +228,7 @@ TEST(ScopeGuard, TEST_SCOPE_EXIT) {
 }
 
 class Foo {
-public:
+ public:
   Foo() {}
   ~Foo() {
     try {
index 257a0e8d811d6911fcc93f834237e18b7b4ad14f..42920e13e99904935f648ea367f6802e3b9bfa87 100644 (file)
@@ -595,7 +595,7 @@ struct Data : DataTracker<(f & IS_RELOCATABLE) != 0>,
   Data& operator=(const Data&) = default;
   Data& operator=(Data&&) = default;
 
-private:
+ private:
   int operator&() const;
 };
 
@@ -1473,7 +1473,8 @@ class DataState {
   typedef typename Vector::size_type size_type;
   size_type size_;
   int* data_;
-public:
+
+ public:
   /* implicit */ DataState(const Vector& v) {
     size_ = v.size();
     if (size_ != 0) {
@@ -1519,7 +1520,7 @@ class Transformer : public boost::iterator_adaptor<
   friend class boost::iterator_core_access;
   shared_ptr<set<It>> dereferenced;
 
-public:
+ public:
   explicit Transformer(const It& it)
     : Transformer::iterator_adaptor_(it)
     , dereferenced(new set<It>()) {}