Fixes issue #1718
diff --git a/include/rapidjson/writer.h b/include/rapidjson/writer.h
index e7fb873..51dd86d 100644
--- a/include/rapidjson/writer.h
+++ b/include/rapidjson/writer.h
@@ -283,6 +283,8 @@
         os_->Flush();
     }
 
+    static const size_t kDefaultLevelDepth = 32;
+
 protected:
     //! Information for each nested level
     struct Level {
@@ -291,8 +293,6 @@
         bool inArray;       //!< true if in array, otherwise in object
     };
 
-    static const size_t kDefaultLevelDepth = 32;
-
     bool WriteNull()  {
         PutReserve(*os_, 4);
         PutUnsafe(*os_, 'n'); PutUnsafe(*os_, 'u'); PutUnsafe(*os_, 'l'); PutUnsafe(*os_, 'l'); return true;