{"id":52,"date":"2015-08-01T09:32:09","date_gmt":"2015-08-01T01:32:09","guid":{"rendered":"http:\/\/zsaber.com\/blog\/?p=52"},"modified":"2019-08-26T15:30:36","modified_gmt":"2019-08-26T07:30:36","slug":"c-%e5%86%85%e5%ad%98%e6%b1%a0%e4%bb%80%e4%b9%88%e7%9a%84","status":"publish","type":"post","link":"http:\/\/zsaber.com\/blog\/p\/52","title":{"rendered":"C++ \u5185\u5b58\u6c60\u4ec0\u4e48\u7684"},"content":{"rendered":"<p>\u6700\u8fd1\u56e0\u4e3a\u67d0\u4e9b\u539f\u56e0\u9f13\u6363\u4e86\u597d\u4e45\u5185\u5b58\u6c60, \u59d1\u4e14\u8bb0\u5f55\u4e00\u4e0b<\/p>\n<p>\u4e4b\u524d\u5bf9\u5185\u5b58\u6c60\u7684\u4e86\u89e3\u53ea\u505c\u7559\u5728\u8868\u9762, \u548b\u770b\u4e00\u4e0b\u597d\u50cf\u6ca1\u5565, \u505a\u8d77\u6765\u5404\u79cd\u5934\u75bc, \u603b\u7ed3\u4e00\u4e0b\u5927\u6982\u6709\u51e0\u79cd\u5b9e\u73b0\u65b9\u5f0f:<\/p>\n<hr \/>\n<ul>\n<li>\n<p>\u53ea\u5206\u914d, \u4e0d\u91ca\u653e, \u800c\u662f\u5728\u5185\u5b58\u6c60\u9500\u6bc1\u65f6\u5168\u90e8\u91ca\u653e, \u5143\u7d20\u5b9a\u957f\u6216\u4e0d\u5b9a\u957f\u5747\u53ef<\/p>\n<p>\u8fd9\u79cd\u6700\u7b80\u5355\u4e86, rapidxml \u4e2d\u7528\u7684\u7c7b\u4f3c\u65b9\u6cd5, \u9002\u5408\u4e8e\u6709\u660e\u786e\u4f5c\u7528\u57df\u7684\u60c5\u5f62, \u800c\u4e14\u901a\u5e38\u4ec5\u9002\u7528\u4e8e POD \u7c7b\u578b,<br \/>\n\u56e0\u4e3a\u4e0d\u9700\u8981\u4fdd\u5b58\u989d\u5916\u4fe1\u606f, \u6240\u4ee5\u6548\u7387\u975e\u5e38\u597d (\u5f53\u7136\u5c40\u9650\u6027\u4e5f\u5f88\u5927)<\/p>\n<\/li>\n<li>\n<p>\u5b9a\u957f POD \u5185\u5b58\u6c60<\/p>\n<p>\u8fd9\u79cd\u4e5f\u6bd4\u8f83\u7b80\u5355, \u7531\u4e8e POD \u7c7b\u578b\u6240\u4ee5\u6ca1\u6709\u6307\u9488\u7684\u591a\u6001\u53d8\u5316, \u5730\u5740\u67e5\u627e\u7b97\u6cd5\u4e5f\u6bd4\u8f83\u7b80\u5355\u9ad8\u6548, \u627e\u5230\u6240\u5c5e buffer, \u9664\u6cd5\u7b97\u51fa\u5185\u5b58\u5757\u7d22\u5f15\u5373\u53ef<\/p>\n<\/li>\n<li>\n<p>\u4e0d\u5b9a\u957f POD \u6216\u5bf9\u8c61\u5185\u5b58\u6c60<\/p>\n<p>\u8fd9\u4e2a\u5c31\u5f88\u590d\u6742\u4e86, \u4e3b\u8981\u95ee\u9898\u5728\u4e8e poolDelete \u65f6\u5982\u4f55\u9ad8\u6548\u7387\u7684\u67e5\u627e\u5230\u6240\u5c5e\u7684\u5185\u5b58\u5757, \u5177\u4f53\u5b9e\u73b0\u65b9\u5f0f\u8fd8\u6ca1\u6df1\u7a76, \u5927\u4f53\u90fd\u662f\u7528\u53cc\u5411\u94fe\u8868<\/p>\n<\/li>\n<\/ul>\n<hr \/>\n<p>\u626f\u76ae\u5b8c\u4e86\u76ee\u524d\u4e86\u89e3\u5230\u7684\u76ae\u6bdb, \u5c1d\u8bd5\u7740\u81ea\u5df1\u5b9e\u73b0\u4e86\u4e00\u4efd, \u5927\u6982\u8bbe\u8ba1\u601d\u8def:<\/p>\n<hr \/>\n<ul>\n<li>\u5185\u5b58\u6c60\u7ef4\u62a4\u4e00\u4e2a &quot;\u5df2\u5206\u914d&quot; \u548c &quot;\u672a\u5206\u914d&quot; \u7684 buffer \u961f\u5217<\/li>\n<li>buffer \u672c\u8eab\u4e0d\u5b9a\u957f, \u5206\u522b\u5305\u542b 32, 64, 128, 256, &#8230; \u5b57\u8282\u7684\u5185\u5b58\u5757\u5e8f\u5217, \u5e8f\u5217\u4e2d\u4f7f\u7528\u53cc\u5411\u94fe\u8868\u4fdd\u5b58\u6570\u636e<\/li>\n<li>\u6bcf\u4e2a\u5bf9\u8c61\u5360\u7528\u4e00\u4e2a\u5185\u5b58\u5757<\/li>\n<li>\u521b\u5efa\u5bf9\u8c61\u65f6\u76f4\u63a5 malloc (\u5185\u5b58\u5757\u5927\u5c0f + \u5934\u4fe1\u606f * 2) (\u4e582 \u7528\u4e8e\u5185\u5b58\u5bf9\u9f50, \u4e0b\u6587\u63d0\u5230), \u7136\u540e\u94fe\u63a5\u5230 &quot;\u5df2\u5206\u914d&quot; \u5217\u8868\u4e2d<\/li>\n<li>\u9500\u6bc1\u5bf9\u8c61\u65f6, \u4f7f\u7528\u7279\u6b8a\u7684\u67e5\u627e\u7b97\u6cd5 (\u4e0b\u6587\u63d0\u5230) \u627e\u5230\u6240\u5c5e\u5185\u5b58\u5757, \u5220\u9664\u5bf9\u8c61\u540e\u5c06\u8be5\u5185\u5b58\u5757\u7f13\u5b58\u56de &quot;\u672a\u5206\u914d&quot; \u4e2d<\/li>\n<\/ul>\n<hr \/>\n<p>\u6570\u636e\u7ed3\u6784:<\/p>\n<pre><code class=\"language-cpp\">class ObjectData {\n    byte *basePtr; \/\/ malloc \u5f97\u5230\u7684\u5185\u5b58\n    byte *objectPtr; \/\/ \u6263\u9664 header \u4ee5\u53ca\u5185\u5b58\u5bf9\u9f50\u540e\u7684\u5bf9\u8c61\u5730\u5740\n    ObjectTypeEnum objectType; \/\/ POD \u6216\u8005 Object \u7b49\u7c7b\u578b\n    int headerVerify; \/\/ \u5173\u952e\u7684\u6821\u9a8c\u4f4d, \u4e0b\u6587\u63d0\u5230\n    ObjectDeleteCallback objectDeleteCallback; \/\/ Object \u9700\u8981\u9500\u6bc1\u56de\u8c03\n    ObjectData *prevData; \/\/ \u53cc\u5411\u94fe\u8868\n    ObjectData *nextData;\n};\nclass MemPool {\n    \/\/ \u5206\u522b\u5305\u542b 32, 64, 128, 256, ... \u5b57\u8282\u7684\u5185\u5b58\u5757,\n    \/\/ \u6bd4\u5982 used[0] \u4fdd\u5b58\u5927\u5c0f\u4e0d\u8d85\u8fc7 32 \u5b57\u8282\u7684\u5bf9\u8c61, \u7b49\u7b49\n    ObjectData used[BLOCK_COUNT];\n    ObjectData unused[BLOCK_COUNT];\n};<\/code><\/pre>\n<hr \/>\n<p>\u5176\u4ed6\u6ca1\u5565\u597d\u8bf4\u7684, \u7b80\u5355\u7684\u53cc\u5411\u94fe\u8868\u63d2\u5165\u548c\u5220\u9664\u7b49\u7b49, \u6700\u5173\u952e\u7684\u95ee\u9898\u5728\u4e8e, \u7ed9\u4e00\u4e2a void * \u6307\u9488, \u5982\u4f55\u627e\u5230\u6240\u5c5e\u7684\u5185\u5b58\u5757<\/p>\n<p>\u89e3\u91ca\u505a\u6cd5\u4e4b\u524d, \u5148\u8bf4\u660e\u4e0b\u8fd9\u70b9\u7684\u86cb\u75bc\u4e4b\u5904, \u5148\u770b\u770b\u4ee3\u7801:<\/p>\n<pre><code class=\"language-cpp\">    ChildType *child = new ChildType();\n    BaseType *base = child;<\/code><\/pre>\n<p>\u5927\u5bb6\u90fd\u5f88\u719f\u7684 C++ \u591a\u6001, \u4e0d\u8fc7\u4f3c\u4e4e\u5f88\u5c11\u4eba\u6ce8\u610f\u8fc7 base \u6307\u9488\u5230\u5e95\u505a\u4e86\u5565\u4e8b, \u4ee5 %p \u6216\u8005 %08X \u6253\u5370\u4e00\u4e0b\u6307\u9488\u5c31\u77e5\u9053\u4e86,<br \/>\nbase \u6307\u9488\u76f8\u5bf9\u4e8e child \u4f1a\u6709\u4e00\u5b9a\u7684\u504f\u79fb\u91cf, \u5177\u4f53\u539f\u56e0\u626f\u5230 C++ \u5185\u5b58\u5e03\u5c40\u76f8\u5173\u7684, \u5c31\u4e0d\u89e3\u91ca\u4e86<\/p>\n<p>\u5f53\u8fd9\u4e00\u673a\u5236\u632a\u5230\u5185\u5b58\u6c60\u4e2d, \u676f\u5177\u5c31\u6765\u4e86, \u6bd4\u5982, \u5f53\u8fd9\u4e2a\u504f\u79fb\u91cf\u5927\u4e8e\u4f60\u7684\u5185\u5b58\u5757\u5355\u4f4d\u5927\u5c0f\u65f6, \u4f60\u7684\u4efb\u4f55\u9ad8\u6548\u7684\u5bfb\u5740\u7b97\u6cd5\u5c31\u6b47\u83dc\u4e86,<br \/>\n\u5f53\u7136\u4f60\u53ef\u4ee5\u989d\u5916\u6dfb\u52a0\u5f88\u591a\u5934\u4fe1\u606f\u6216\u5904\u7406\u65b9\u5f0f\u6765\u89e3\u51b3\u8fd9\u4e00\u95ee\u9898, \u4f46\u662f, \u6548\u7387\u53c8\u4e0b\u53bb\u4e86<\/p>\n<hr \/>\n<p>\u597d\u4e86, \u73b0\u5728\u6765\u8bf4\u660e\u4e0b\u8111\u6d1e\u5927\u5f00\u7684\u5b9e\u73b0\u65b9\u5f0f, \u7384\u5999\u5728\u4e8e malloc \u65f6\u7684\u5185\u5b58\u5bf9\u9f50\u4ee5\u53ca\u7528\u4f5c\u6821\u9a8c\u7684 headerVerify:<\/p>\n<ul>\n<li>\n<p>\u901a\u5e38\u5185\u5b58\u6c60\u4e2d\u5185\u5b58\u5757\u7684\u5185\u5b58\u5e03\u5c40\u4e3a (\u5934\u4fe1\u606f + \u5bf9\u8c61\u5185\u5b58), \u4f46\u8fd9\u91cc\u65b0\u589e\u4e00\u6761\u8981\u6c42, \u5373\u5934\u4fe1\u606f\u7684\u8d77\u59cb\u5730\u5740\u5fc5\u987b\u4e0e sizeof(ObjectData) \u5bf9\u9f50<\/p>\n<p>\u5927\u4f53\u7b97\u6cd5\u662f: (\u4e3a\u6e05\u6670\u660e\u4e86, \u90e8\u5206\u5f3a\u5236\u8f6c\u6362\u4ee3\u7801\u672a\u5199)<\/p>\n<pre><code class=\"language-cpp\">byte *basePtr = malloc(sizeof(ObjectData) * 2 + object_size);\nObjectData *objectData = basePtr + sizeof(ObjectData) - (basePtr % sizeof(ObjectData));<\/code><\/pre>\n<\/li>\n<li>\n<p>\u6709\u4e86\u4e0a\u8ff0\u4fdd\u8bc1, \u7ed9\u5b9a\u4e00\u4e2a\u6307\u9488, \u5373\u53ef\u5feb\u901f\u627e\u5230\u6240\u5c5e\u5185\u5b58\u5757:<\/p>\n<pre><code class=\"language-cpp\">byte *checkingPtr = p - (p % sizeof(ObjectData));\nwhile(!isObjectDataValid(checkingPtr)) {\n    checkingPtr -= sizeof(ObjectData);\n}<\/code><\/pre>\n<\/li>\n<li>\n<p>\u600e\u6837\u5224\u65ad checkingPtr \u662f\u5426\u662f\u8981\u627e\u7684\u5185\u5b58\u5757\u5462? \u8fd9\u65f6\u5c31\u8981\u7528\u5230\u4e4b\u524d\u63d0\u5230\u7684 headerVerify \u6765\u6821\u9a8c\u8fd9\u6bb5\u5185\u5b58\u662f\u5426\u662f\u6709\u6548\u7684\u5185\u5b58\u5757\u5934\u4fe1\u606f\u4e86<\/p>\n<p>\u8fd9\u4e2a\u505a\u6cd5\u5c31\u5f88\u591a\u4e86, \u4e3a\u4e86\u6548\u7387, \u5c06 basePtr, objectPtr \u7b49\u4e0e\u5185\u5b58\u5730\u5740\u6709\u5173\u4e14\u4e0d\u4f1a\u53d8\u52a8\u7684\u5185\u5bb9,<br \/>\n\u7528\u4e0e\u8fd0\u7b97\u548c\u6216\u8fd0\u7b97\u505a\u6821\u9a8c, \u7406\u8bba\u4e0a\u4e0d\u5bb9\u6613\u51fa\u73b0\u51b2\u7a81\u7684\u60c5\u51b5<\/p>\n<\/li>\n<\/ul>\n<hr \/>\n<p>\u5dee\u4e0d\u591a\u5c31\u8fd9\u4e48\u56de\u4e8b, \u6bd4\u8d77\u4f20\u7edf\u610f\u4e49\u4e0a\u7684\u5185\u5b58\u6c60, \u5012\u662f\u66f4\u50cf cache \u6216\u5bf9\u8c61\u6c60<\/p>\n<p>\u7b80\u5355\u6d4b\u8bd5\u6027\u80fd\u63d0\u5347\u5927\u7ea6\u53ea\u6709 1.5 \u500d\u5de6\u53f3, \u6781\u7aef\u60c5\u51b5\u4e0b\u53ef\u80fd\u6bd4\u4e0d\u7528\u5185\u5b58\u6c60\u6027\u80fd\u8fd8\u5dee 2 \u500d\u5de6\u53f3 (\u6bd4\u5982\u4e00\u76f4\u521b\u5efa\u4e0d\u9500\u6bc1)<\/p>\n<p>\u603b\u7ed3\u4e00\u4e0b:<\/p>\n<ul>\n<li>\n<p>\u4f18\u70b9\u4ec0\u4e48\u7684\u5c31\u662f\u4f7f\u7528\u7075\u6d3b, \u4efb\u610f\u7c7b\u578b\u4efb\u610f\u957f\u5ea6\u901a\u5403\u4e14\u4e0d\u7528\u62c5\u5fc3\u5bf9\u8c61\u6790\u6784\u7684\u95ee\u9898, \u505a\u4e9b\u5c0f\u6280\u5de7\u751a\u81f3\u80fd\u652f\u6301 protected\/private \u6784\u9020\u51fd\u6570\u7684\u5bf9\u8c61<\/p>\n<\/li>\n<li>\n<p>\u7f3a\u70b9\u4ec0\u4e48\u7684\u4e5f\u86ee\u591a: \u5185\u5b58\u6d6a\u8d39\u7565\u4e25\u91cd (\u6bcf\u4e2a\u5185\u5b58\u5757\u8981\u989d\u5916\u5360\u7528 (\u5934\u4fe1\u606f*2) \u5b57\u8282\u7684\u5927\u5c0f), \u5bf9\u5185\u5b58\u788e\u7247\u4e5f\u6ca1\u5565\u592a\u5927\u5e2e\u52a9,<br \/>\n\u800c\u4e14\u5f53 delete \u4e00\u4e2a\u65e0\u6548\u6307\u9488\u7684\u65f6\u5019, \u53ef\u80fd\u56e0\u4e3a\u5934\u4fe1\u606f\u6821\u9a8c\u8fc7\u7a0b\u4e2d\u7684\u975e\u6cd5\u5185\u5b58\u8bbf\u95ee\u800c\u76f4\u63a5\u9020\u6210\u6b7b\u673a, \u8fde\u8f93\u51fa\u8b66\u544a\u7684\u673a\u4f1a\u90fd\u6ca1\u6709<\/p>\n<\/li>\n<li>\n<p>\u603b\u7684\u6765\u8bf4, \u4e2a\u4eba\u8fd8\u662f\u5efa\u8bae\u4f7f\u7528\u5b9a\u957f\/\u56fa\u5b9a\u7c7b\u578b\u7684\u5185\u5b58\u6c60, \u6ca1\u6709\u5fc5\u8981\u53bb\u5f04\u8fd9\u4e48\u590d\u6742\u7684\u4e0d\u5b9a\u957f\/\u4e0d\u5b9a\u7c7b\u578b\u7684\u5185\u5b58\u6c60, \u590d\u6742\u5ea6\u592a\u9ad8, \u6027\u80fd\u63d0\u5347\u5374\u5e76\u4e0d\u660e\u663e<\/p>\n<\/li>\n<\/ul>\n","protected":false},"excerpt":{"rendered":"<p>\u6700\u8fd1\u56e0\u4e3a\u67d0\u4e9b\u539f\u56e0\u9f13\u6363\u4e86\u597d\u4e45\u5185\u5b58\u6c60, \u59d1\u4e14\u8bb0\u5f55\u4e00\u4e0b \u4e4b\u524d\u5bf9\u5185\u5b58\u6c60\u7684\u4e86\u89e3\u53ea\u505c\u7559\u5728\u8868\u9762, \u548b\u770b\u4e00\u4e0b\u597d\u50cf\u6ca1\u5565, \u505a\u8d77\u6765\u2026 <span class=\"read-more\"><a href=\"http:\/\/zsaber.com\/blog\/p\/52\">Read More &raquo;<\/a><\/span><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[5],"tags":[],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v23.0 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>C++ \u5185\u5b58\u6c60\u4ec0\u4e48\u7684 - \u67d0Z\u7684\u535a\u5ba2<\/title>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"http:\/\/zsaber.com\/blog\/p\/52\" \/>\n<meta property=\"og:locale\" content=\"zh_CN\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"C++ \u5185\u5b58\u6c60\u4ec0\u4e48\u7684 - \u67d0Z\u7684\u535a\u5ba2\" \/>\n<meta property=\"og:description\" content=\"\u6700\u8fd1\u56e0\u4e3a\u67d0\u4e9b\u539f\u56e0\u9f13\u6363\u4e86\u597d\u4e45\u5185\u5b58\u6c60, \u59d1\u4e14\u8bb0\u5f55\u4e00\u4e0b \u4e4b\u524d\u5bf9\u5185\u5b58\u6c60\u7684\u4e86\u89e3\u53ea\u505c\u7559\u5728\u8868\u9762, \u548b\u770b\u4e00\u4e0b\u597d\u50cf\u6ca1\u5565, \u505a\u8d77\u6765\u2026 Read More &raquo;\" \/>\n<meta property=\"og:url\" content=\"http:\/\/zsaber.com\/blog\/p\/52\" \/>\n<meta property=\"og:site_name\" content=\"\u67d0Z\u7684\u535a\u5ba2\" \/>\n<meta property=\"article:published_time\" content=\"2015-08-01T01:32:09+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2019-08-26T07:30:36+00:00\" \/>\n<meta name=\"author\" content=\"Z\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"\u4f5c\u8005\" \/>\n\t<meta name=\"twitter:data1\" content=\"Z\" \/>\n\t<meta name=\"twitter:label2\" content=\"\u9884\u8ba1\u9605\u8bfb\u65f6\u95f4\" \/>\n\t<meta name=\"twitter:data2\" content=\"1 \u5206\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"http:\/\/zsaber.com\/blog\/p\/52#article\",\"isPartOf\":{\"@id\":\"http:\/\/zsaber.com\/blog\/p\/52\"},\"author\":{\"name\":\"Z\",\"@id\":\"http:\/\/zsaber.com\/blog\/#\/schema\/person\/6a6701fc719eff087e24e39a00e2280f\"},\"headline\":\"C++ \u5185\u5b58\u6c60\u4ec0\u4e48\u7684\",\"datePublished\":\"2015-08-01T01:32:09+00:00\",\"dateModified\":\"2019-08-26T07:30:36+00:00\",\"mainEntityOfPage\":{\"@id\":\"http:\/\/zsaber.com\/blog\/p\/52\"},\"wordCount\":39,\"commentCount\":0,\"publisher\":{\"@id\":\"http:\/\/zsaber.com\/blog\/#\/schema\/person\/6a6701fc719eff087e24e39a00e2280f\"},\"articleSection\":[\"C++\"],\"inLanguage\":\"zh-Hans\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"http:\/\/zsaber.com\/blog\/p\/52#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"http:\/\/zsaber.com\/blog\/p\/52\",\"url\":\"http:\/\/zsaber.com\/blog\/p\/52\",\"name\":\"C++ \u5185\u5b58\u6c60\u4ec0\u4e48\u7684 - \u67d0Z\u7684\u535a\u5ba2\",\"isPartOf\":{\"@id\":\"http:\/\/zsaber.com\/blog\/#website\"},\"datePublished\":\"2015-08-01T01:32:09+00:00\",\"dateModified\":\"2019-08-26T07:30:36+00:00\",\"breadcrumb\":{\"@id\":\"http:\/\/zsaber.com\/blog\/p\/52#breadcrumb\"},\"inLanguage\":\"zh-Hans\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"http:\/\/zsaber.com\/blog\/p\/52\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"http:\/\/zsaber.com\/blog\/p\/52#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"\u9996\u9875\",\"item\":\"http:\/\/zsaber.com\/blog\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"C++ \u5185\u5b58\u6c60\u4ec0\u4e48\u7684\"}]},{\"@type\":\"WebSite\",\"@id\":\"http:\/\/zsaber.com\/blog\/#website\",\"url\":\"http:\/\/zsaber.com\/blog\/\",\"name\":\"\u67d0Z\u7684\u535a\u5ba2\",\"description\":\"\u7b80\u4ecb\u53c8\u4e0d\u80fd\u5403\",\"publisher\":{\"@id\":\"http:\/\/zsaber.com\/blog\/#\/schema\/person\/6a6701fc719eff087e24e39a00e2280f\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"http:\/\/zsaber.com\/blog\/?s={search_term_string}\"},\"query-input\":\"required name=search_term_string\"}],\"inLanguage\":\"zh-Hans\"},{\"@type\":[\"Person\",\"Organization\"],\"@id\":\"http:\/\/zsaber.com\/blog\/#\/schema\/person\/6a6701fc719eff087e24e39a00e2280f\",\"name\":\"Z\",\"logo\":{\"@id\":\"http:\/\/zsaber.com\/blog\/#\/schema\/person\/image\/\"},\"description\":\"\u67d0Z\",\"sameAs\":[\"http:\/\/ZFFramework.com\"]}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"C++ \u5185\u5b58\u6c60\u4ec0\u4e48\u7684 - \u67d0Z\u7684\u535a\u5ba2","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"http:\/\/zsaber.com\/blog\/p\/52","og_locale":"zh_CN","og_type":"article","og_title":"C++ \u5185\u5b58\u6c60\u4ec0\u4e48\u7684 - \u67d0Z\u7684\u535a\u5ba2","og_description":"\u6700\u8fd1\u56e0\u4e3a\u67d0\u4e9b\u539f\u56e0\u9f13\u6363\u4e86\u597d\u4e45\u5185\u5b58\u6c60, \u59d1\u4e14\u8bb0\u5f55\u4e00\u4e0b \u4e4b\u524d\u5bf9\u5185\u5b58\u6c60\u7684\u4e86\u89e3\u53ea\u505c\u7559\u5728\u8868\u9762, \u548b\u770b\u4e00\u4e0b\u597d\u50cf\u6ca1\u5565, \u505a\u8d77\u6765\u2026 Read More &raquo;","og_url":"http:\/\/zsaber.com\/blog\/p\/52","og_site_name":"\u67d0Z\u7684\u535a\u5ba2","article_published_time":"2015-08-01T01:32:09+00:00","article_modified_time":"2019-08-26T07:30:36+00:00","author":"Z","twitter_card":"summary_large_image","twitter_misc":{"\u4f5c\u8005":"Z","\u9884\u8ba1\u9605\u8bfb\u65f6\u95f4":"1 \u5206"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"http:\/\/zsaber.com\/blog\/p\/52#article","isPartOf":{"@id":"http:\/\/zsaber.com\/blog\/p\/52"},"author":{"name":"Z","@id":"http:\/\/zsaber.com\/blog\/#\/schema\/person\/6a6701fc719eff087e24e39a00e2280f"},"headline":"C++ \u5185\u5b58\u6c60\u4ec0\u4e48\u7684","datePublished":"2015-08-01T01:32:09+00:00","dateModified":"2019-08-26T07:30:36+00:00","mainEntityOfPage":{"@id":"http:\/\/zsaber.com\/blog\/p\/52"},"wordCount":39,"commentCount":0,"publisher":{"@id":"http:\/\/zsaber.com\/blog\/#\/schema\/person\/6a6701fc719eff087e24e39a00e2280f"},"articleSection":["C++"],"inLanguage":"zh-Hans","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["http:\/\/zsaber.com\/blog\/p\/52#respond"]}]},{"@type":"WebPage","@id":"http:\/\/zsaber.com\/blog\/p\/52","url":"http:\/\/zsaber.com\/blog\/p\/52","name":"C++ \u5185\u5b58\u6c60\u4ec0\u4e48\u7684 - \u67d0Z\u7684\u535a\u5ba2","isPartOf":{"@id":"http:\/\/zsaber.com\/blog\/#website"},"datePublished":"2015-08-01T01:32:09+00:00","dateModified":"2019-08-26T07:30:36+00:00","breadcrumb":{"@id":"http:\/\/zsaber.com\/blog\/p\/52#breadcrumb"},"inLanguage":"zh-Hans","potentialAction":[{"@type":"ReadAction","target":["http:\/\/zsaber.com\/blog\/p\/52"]}]},{"@type":"BreadcrumbList","@id":"http:\/\/zsaber.com\/blog\/p\/52#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"\u9996\u9875","item":"http:\/\/zsaber.com\/blog"},{"@type":"ListItem","position":2,"name":"C++ \u5185\u5b58\u6c60\u4ec0\u4e48\u7684"}]},{"@type":"WebSite","@id":"http:\/\/zsaber.com\/blog\/#website","url":"http:\/\/zsaber.com\/blog\/","name":"\u67d0Z\u7684\u535a\u5ba2","description":"\u7b80\u4ecb\u53c8\u4e0d\u80fd\u5403","publisher":{"@id":"http:\/\/zsaber.com\/blog\/#\/schema\/person\/6a6701fc719eff087e24e39a00e2280f"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"http:\/\/zsaber.com\/blog\/?s={search_term_string}"},"query-input":"required name=search_term_string"}],"inLanguage":"zh-Hans"},{"@type":["Person","Organization"],"@id":"http:\/\/zsaber.com\/blog\/#\/schema\/person\/6a6701fc719eff087e24e39a00e2280f","name":"Z","logo":{"@id":"http:\/\/zsaber.com\/blog\/#\/schema\/person\/image\/"},"description":"\u67d0Z","sameAs":["http:\/\/ZFFramework.com"]}]}},"_links":{"self":[{"href":"http:\/\/zsaber.com\/blog\/wp-json\/wp\/v2\/posts\/52"}],"collection":[{"href":"http:\/\/zsaber.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/zsaber.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/zsaber.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"http:\/\/zsaber.com\/blog\/wp-json\/wp\/v2\/comments?post=52"}],"version-history":[{"count":0,"href":"http:\/\/zsaber.com\/blog\/wp-json\/wp\/v2\/posts\/52\/revisions"}],"wp:attachment":[{"href":"http:\/\/zsaber.com\/blog\/wp-json\/wp\/v2\/media?parent=52"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/zsaber.com\/blog\/wp-json\/wp\/v2\/categories?post=52"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/zsaber.com\/blog\/wp-json\/wp\/v2\/tags?post=52"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}