{"id":3337,"date":"2025-03-29T17:19:43","date_gmt":"2025-03-29T09:19:43","guid":{"rendered":"https:\/\/www.laixuexila.com\/?p=3337"},"modified":"2025-03-29T17:19:43","modified_gmt":"2025-03-29T09:19:43","slug":"c-%e5%a4%9a%e7%ba%bf%e7%a8%8b","status":"publish","type":"post","link":"https:\/\/www.laixuexila.com\/index.php\/2025\/03\/29\/c-%e5%a4%9a%e7%ba%bf%e7%a8%8b\/","title":{"rendered":"C++ \u591a\u7ebf\u7a0b"},"content":{"rendered":"\n<p>C++ \u591a\u7ebf\u7a0b\u7f16\u7a0b\u5141\u8bb8\u7a0b\u5e8f\u5e76\u884c\u6267\u884c\u591a\u4e2a\u4efb\u52a1\uff0c\u8fd9\u6837\u53ef\u4ee5\u6709\u6548\u5730\u5229\u7528\u591a\u6838\u5904\u7406\u5668\uff0c\u63d0\u9ad8\u7a0b\u5e8f\u7684\u6027\u80fd\u548c\u54cd\u5e94\u901f\u5ea6\u3002C++11 \u5f15\u5165\u4e86\u5bf9\u591a\u7ebf\u7a0b\u7684\u6807\u51c6\u652f\u6301\uff0c\u4f7f\u5f97\u7ebf\u7a0b\u521b\u5efa\u3001\u540c\u6b65\u548c\u7ba1\u7406\u53d8\u5f97\u66f4\u52a0\u7b80\u5355\u548c\u76f4\u89c2\u3002\u672c\u6587\u5c06\u8be6\u7ec6\u4ecb\u7ecd C++ \u4e2d\u7684\u591a\u7ebf\u7a0b\u7f16\u7a0b\u3002<\/p>\n\n\n\n<h2 class=\"wp-block-heading\"><strong>1. C++ \u591a\u7ebf\u7a0b\u57fa\u7840<\/strong><\/h2>\n\n\n\n<p>C++11 \u5f15\u5165\u4e86 <code>&lt;thread&gt;<\/code> \u5934\u6587\u4ef6\uff0c\u5b83\u63d0\u4f9b\u4e86\u521b\u5efa\u548c\u7ba1\u7406\u7ebf\u7a0b\u7684\u6807\u51c6\u63a5\u53e3\u3002\u8981\u4f7f\u7528\u591a\u7ebf\u7a0b\uff0c\u9700\u8981\u5305\u542b <code>&lt;thread&gt;<\/code> \u5934\u6587\u4ef6\u3002<\/p>\n\n\n\n<h3 class=\"wp-block-heading\"><strong>1.1 \u521b\u5efa\u7ebf\u7a0b<\/strong><\/h3>\n\n\n\n<p>C++ \u4f7f\u7528 <code>std::thread<\/code> \u7c7b\u6765\u8868\u793a\u548c\u7ba1\u7406\u7ebf\u7a0b\u3002\u7ebf\u7a0b\u7684\u521b\u5efa\u975e\u5e38\u7b80\u5355\uff0c\u521b\u5efa\u7ebf\u7a0b\u65f6\u53ef\u4ee5\u901a\u8fc7\u4f20\u9012\u4e00\u4e2a\u53ef\u8c03\u7528\u5bf9\u8c61\uff08\u5982\u51fd\u6570\u3001lambda \u8868\u8fbe\u5f0f\u3001\u6210\u5458\u51fd\u6570\u7b49\uff09\u6765\u542f\u52a8\u7ebf\u7a0b\u3002<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>#include &lt;iostream&gt;\n#include &lt;thread&gt;\n\nvoid print_hello() {\n    std::cout &lt;&lt; \"Hello from thread!\" &lt;&lt; std::endl;\n}\n\nint main() {\n    \/\/ \u521b\u5efa\u5e76\u542f\u52a8\u7ebf\u7a0b\n    std::thread t(print_hello);\n\n    \/\/ \u7b49\u5f85\u7ebf\u7a0b\u7ed3\u675f\n    t.join();  \/\/ \u963b\u585e\u4e3b\u7ebf\u7a0b\uff0c\u76f4\u5230 t \u7ebf\u7a0b\u6267\u884c\u5b8c\u6bd5\n\n    return 0;\n}<\/code><\/pre>\n\n\n\n<p><strong>\u8bf4\u660e\uff1a<\/strong><\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li><code>std::thread t(print_hello);<\/code> \u521b\u5efa\u4e00\u4e2a\u65b0\u7ebf\u7a0b\u5e76\u6267\u884c <code>print_hello<\/code> \u51fd\u6570\u3002<\/li>\n\n\n\n<li><code>t.join()<\/code> \u963b\u585e\u4e3b\u7ebf\u7a0b\uff0c\u76f4\u5230 <code>t<\/code> \u7ebf\u7a0b\u6267\u884c\u5b8c\u6bd5\u3002\u5982\u679c\u4e0d\u8c03\u7528 <code>join()<\/code> \u6216 <code>detach()<\/code>\uff0c\u7a0b\u5e8f\u4f1a\u7ec8\u6b62\u65f6\u629b\u51fa\u5f02\u5e38\u3002<\/li>\n<\/ul>\n\n\n\n<h3 class=\"wp-block-heading\"><strong>1.2 <code>join()<\/code> \u4e0e <code>detach()<\/code><\/strong><\/h3>\n\n\n\n<ul class=\"wp-block-list\">\n<li><strong><code>join()<\/code><\/strong>\uff1a\u963b\u585e\u5f53\u524d\u7ebf\u7a0b\uff0c\u7b49\u5f85\u7ebf\u7a0b\u6267\u884c\u5b8c\u6bd5\u540e\u518d\u7ee7\u7eed\u6267\u884c\u3002\u901a\u5e38\u5728\u4e3b\u7ebf\u7a0b\u4e2d\u8c03\u7528 <code>join()<\/code> \u6765\u7b49\u5f85\u5b50\u7ebf\u7a0b\u7684\u5b8c\u6210\u3002<\/li>\n\n\n\n<li><strong><code>detach()<\/code><\/strong>\uff1a\u4f7f\u7ebf\u7a0b\u8131\u79bb\u5f53\u524d\u7ebf\u7a0b\uff0c\u72ec\u7acb\u6267\u884c\u3002\u8131\u79bb\u7684\u7ebf\u7a0b\u5728\u5b8c\u6210\u540e\u4e0d\u4f1a\u5f71\u54cd\u4e3b\u7ebf\u7a0b\u7684\u7ed3\u675f\uff0c\u56e0\u6b64\u9700\u8981\u6ce8\u610f\u5176\u751f\u547d\u5468\u671f\u3002<\/li>\n<\/ul>\n\n\n\n<pre class=\"wp-block-code\"><code>#include &lt;iostream&gt;\n#include &lt;thread&gt;\n\nvoid print_hello() {\n    std::cout &lt;&lt; \"Hello from detached thread!\" &lt;&lt; std::endl;\n}\n\nint main() {\n    std::thread t(print_hello);\n    t.detach();  \/\/ \u8131\u79bb\u7ebf\u7a0b\uff0c\u4e0d\u7b49\u5f85\u5b83\u5b8c\u6210\n\n    std::cout &lt;&lt; \"Main thread continues execution.\" &lt;&lt; std::endl;\n\n    \/\/ \u7a0b\u5e8f\u7ed3\u675f\u65f6\uff0ct \u7ebf\u7a0b\u53ef\u80fd\u5c1a\u672a\u6267\u884c\u5b8c\u6bd5\n    return 0;\n}<\/code><\/pre>\n\n\n\n<p><strong>\u8bf4\u660e\uff1a<\/strong><\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li><code>t.detach()<\/code> \u4f1a\u4f7f <code>t<\/code> \u7ebf\u7a0b\u8131\u79bb\u4e3b\u7ebf\u7a0b\u3002\u8131\u79bb\u7684\u7ebf\u7a0b\u5728\u5b8c\u6210\u540e\u4e0d\u518d\u9700\u8981\u4e3b\u7ebf\u7a0b\u7b49\u5f85\u3002<\/li>\n<\/ul>\n\n\n\n<h2 class=\"wp-block-heading\"><strong>2. \u7ebf\u7a0b\u53c2\u6570\u4f20\u9012<\/strong><\/h2>\n\n\n\n<p>\u7ebf\u7a0b\u51fd\u6570\u53ef\u4ee5\u63a5\u53d7\u53c2\u6570\uff0c\u8fd9\u4e9b\u53c2\u6570\u53ef\u4ee5\u901a\u8fc7\u503c\u4f20\u9012\u6216\u5f15\u7528\u4f20\u9012\u3002<\/p>\n\n\n\n<h3 class=\"wp-block-heading\"><strong>2.1 \u503c\u4f20\u9012<\/strong><\/h3>\n\n\n\n<pre class=\"wp-block-code\"><code>#include &lt;iostream&gt;\n#include &lt;thread&gt;\n\nvoid print_number(int n) {\n    std::cout &lt;&lt; \"Number: \" &lt;&lt; n &lt;&lt; std::endl;\n}\n\nint main() {\n    int number = 5;\n    std::thread t(print_number, number);  \/\/ \u503c\u4f20\u9012\u53c2\u6570\n    t.join();\n    return 0;\n}<\/code><\/pre>\n\n\n\n<p><strong>\u8bf4\u660e\uff1a<\/strong><\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>\u4f20\u9012\u53c2\u6570\u65f6\uff0cC++ \u4f1a\u81ea\u52a8\u5c06\u53c2\u6570\u8fdb\u884c\u590d\u5236\uff0c\u5373\u503c\u4f20\u9012\u3002<\/li>\n<\/ul>\n\n\n\n<h3 class=\"wp-block-heading\"><strong>2.2 \u5f15\u7528\u4f20\u9012<\/strong><\/h3>\n\n\n\n<p>\u82e5\u8981\u4f20\u9012\u5f15\u7528\uff0c\u53ef\u4ee5\u4f7f\u7528 <code>std::ref<\/code> \u6765\u907f\u514d\u590d\u5236\u3002<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>#include &lt;iostream&gt;\n#include &lt;thread&gt;\n\nvoid increment(int&amp; n) {\n    ++n;\n    std::cout &lt;&lt; \"Incremented: \" &lt;&lt; n &lt;&lt; std::endl;\n}\n\nint main() {\n    int number = 5;\n    std::thread t(increment, std::ref(number));  \/\/ \u5f15\u7528\u4f20\u9012\n    t.join();\n    std::cout &lt;&lt; \"Main number: \" &lt;&lt; number &lt;&lt; std::endl;\n    return 0;\n}<\/code><\/pre>\n\n\n\n<p><strong>\u8bf4\u660e\uff1a<\/strong><\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li><code>std::ref(number)<\/code> \u4f20\u9012\u7684\u662f <code>number<\/code> \u7684\u5f15\u7528\uff0c\u800c\u4e0d\u662f\u5b83\u7684\u526f\u672c\u3002\u8fd9\u6837 <code>increment<\/code> \u51fd\u6570\u53ef\u4ee5\u76f4\u63a5\u4fee\u6539\u539f\u59cb\u6570\u636e\u3002<\/li>\n<\/ul>\n\n\n\n<h2 class=\"wp-block-heading\"><strong>3. \u7ebf\u7a0b\u540c\u6b65<\/strong><\/h2>\n\n\n\n<p>\u5728\u591a\u7ebf\u7a0b\u73af\u5883\u4e2d\uff0c\u591a\u4e2a\u7ebf\u7a0b\u53ef\u80fd\u4f1a\u5e76\u53d1\u8bbf\u95ee\u5171\u4eab\u8d44\u6e90\uff0c\u9020\u6210\u6570\u636e\u7ade\u6001\u95ee\u9898\u3002C++ \u63d0\u4f9b\u4e86\u591a\u79cd\u540c\u6b65\u673a\u5236\u6765\u89e3\u51b3\u8fd9\u4e2a\u95ee\u9898\uff0c\u5982\u4e92\u65a5\u91cf\uff08mutex\uff09\u548c\u6761\u4ef6\u53d8\u91cf\uff08condition_variable\uff09\u3002<\/p>\n\n\n\n<h3 class=\"wp-block-heading\"><strong>3.1 \u4e92\u65a5\u91cf\uff08mutex\uff09<\/strong><\/h3>\n\n\n\n<p>\u4e92\u65a5\u91cf\u7528\u4e8e\u4fdd\u8bc1\u540c\u4e00\u65f6\u523b\u53ea\u6709\u4e00\u4e2a\u7ebf\u7a0b\u8bbf\u95ee\u5171\u4eab\u8d44\u6e90\u3002C++11 \u5f15\u5165\u4e86 <code>std::mutex<\/code>\uff0c\u5b83\u63d0\u4f9b\u4e86\u57fa\u672c\u7684\u4e92\u65a5\u64cd\u4f5c\u3002<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>#include &lt;iostream&gt;\n#include &lt;thread&gt;\n#include &lt;mutex&gt;\n\nstd::mutex mtx;  \/\/ \u58f0\u660e\u4e00\u4e2a\u4e92\u65a5\u91cf\n\nvoid print_hello() {\n    mtx.lock();  \/\/ \u4e0a\u9501\n    std::cout &lt;&lt; \"Hello from thread!\" &lt;&lt; std::endl;\n    mtx.unlock();  \/\/ \u89e3\u9501\n}\n\nint main() {\n    std::thread t1(print_hello);\n    std::thread t2(print_hello);\n\n    t1.join();\n    t2.join();\n\n    return 0;\n}<\/code><\/pre>\n\n\n\n<p><strong>\u8bf4\u660e\uff1a<\/strong><\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li><code>std::mutex mtx;<\/code> \u58f0\u660e\u4e00\u4e2a\u4e92\u65a5\u91cf\u5bf9\u8c61\u3002<\/li>\n\n\n\n<li><code>mtx.lock()<\/code> \u4e0a\u9501\uff0c\u4fdd\u8bc1\u5f53\u524d\u7ebf\u7a0b\u72ec\u5360\u5bf9\u8d44\u6e90\u7684\u8bbf\u95ee\u3002<\/li>\n\n\n\n<li><code>mtx.unlock()<\/code> \u89e3\u9501\uff0c\u5141\u8bb8\u5176\u4ed6\u7ebf\u7a0b\u8bbf\u95ee\u3002<\/li>\n<\/ul>\n\n\n\n<h3 class=\"wp-block-heading\"><strong>3.2 <code>std::lock_guard<\/code> \u548c <code>std::unique_lock<\/code><\/strong><\/h3>\n\n\n\n<p><code>std::lock_guard<\/code> \u662f\u4e00\u79cd\u7b80\u5316\u7684\u9501\u673a\u5236\uff0c\u5b83\u4f1a\u5728\u4f5c\u7528\u57df\u7ed3\u675f\u65f6\u81ea\u52a8\u91ca\u653e\u9501\uff0c\u4ece\u800c\u907f\u514d\u4e86\u624b\u52a8\u8c03\u7528 <code>unlock()<\/code>\u3002<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>#include &lt;iostream&gt;\n#include &lt;thread&gt;\n#include &lt;mutex&gt;\n\nstd::mutex mtx;\n\nvoid print_hello() {\n    std::lock_guard&lt;std::mutex&gt; lock(mtx);  \/\/ \u81ea\u52a8\u4e0a\u9501\u548c\u89e3\u9501\n    std::cout &lt;&lt; \"Hello from thread!\" &lt;&lt; std::endl;\n}\n\nint main() {\n    std::thread t1(print_hello);\n    std::thread t2(print_hello);\n\n    t1.join();\n    t2.join();\n\n    return 0;\n}<\/code><\/pre>\n\n\n\n<p><strong>\u8bf4\u660e\uff1a<\/strong><\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li><code>std::lock_guard<\/code> \u5728\u6784\u9020\u65f6\u4e0a\u9501\uff0c\u5728\u6790\u6784\u65f6\u81ea\u52a8\u89e3\u9501\uff0c\u4ece\u800c\u907f\u514d\u5fd8\u8bb0\u89e3\u9501\u7684\u9519\u8bef\u3002<\/li>\n<\/ul>\n\n\n\n<h3 class=\"wp-block-heading\"><strong>3.3 \u6761\u4ef6\u53d8\u91cf\uff08<code>std::condition_variable<\/code>\uff09<\/strong><\/h3>\n\n\n\n<p>\u6761\u4ef6\u53d8\u91cf\u7528\u4e8e\u5b9e\u73b0\u7ebf\u7a0b\u4e4b\u95f4\u7684\u901a\u4fe1\u3002\u4e00\u4e2a\u7ebf\u7a0b\u53ef\u4ee5\u7b49\u5f85\u6761\u4ef6\u53d8\u91cf\uff0c\u53e6\u4e00\u4e2a\u7ebf\u7a0b\u53ef\u4ee5\u901a\u8fc7\u901a\u77e5\u6761\u4ef6\u53d8\u91cf\u6765\u5524\u9192\u7b49\u5f85\u7684\u7ebf\u7a0b\u3002<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>#include &lt;iostream&gt;\n#include &lt;thread&gt;\n#include &lt;mutex&gt;\n#include &lt;condition_variable&gt;\n\nstd::mutex mtx;\nstd::condition_variable cv;\nbool ready = false;\n\nvoid print_hello() {\n    std::unique_lock&lt;std::mutex&gt; lock(mtx);\n    while (!ready) {\n        cv.wait(lock);  \/\/ \u7b49\u5f85\u6761\u4ef6\u53d8\u91cf\n    }\n    std::cout &lt;&lt; \"Hello from thread!\" &lt;&lt; std::endl;\n}\n\nint main() {\n    std::thread t1(print_hello);\n    std::this_thread::sleep_for(std::chrono::seconds(1));\n    {\n        std::lock_guard&lt;std::mutex&gt; lock(mtx);\n        ready = true;  \/\/ \u8bbe\u7f6e\u6761\u4ef6\n    }\n    cv.notify_one();  \/\/ \u901a\u77e5\u4e00\u4e2a\u7ebf\u7a0b\n    t1.join();\n    return 0;\n}<\/code><\/pre>\n\n\n\n<p><strong>\u8bf4\u660e\uff1a<\/strong><\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li><code>cv.wait(lock)<\/code> \u4f1a\u8ba9\u7ebf\u7a0b\u5728\u6761\u4ef6\u53d8\u91cf\u4e0a\u7b49\u5f85\uff0c\u76f4\u5230\u53e6\u4e00\u4e2a\u7ebf\u7a0b\u8c03\u7528 <code>cv.notify_one()<\/code> \u6216 <code>cv.notify_all()<\/code>\u3002<\/li>\n\n\n\n<li><code>std::unique_lock<\/code> \u7528\u4e8e\u4e0e\u6761\u4ef6\u53d8\u91cf\u4e00\u8d77\u5de5\u4f5c\uff0c\u5b83\u53ef\u4ee5\u5728 <code>wait<\/code> \u548c <code>notify<\/code> \u8fc7\u7a0b\u4e2d\u81ea\u52a8\u91ca\u653e\u548c\u83b7\u53d6\u9501\u3002<\/li>\n<\/ul>\n\n\n\n<h2 class=\"wp-block-heading\"><strong>4. \u7ebf\u7a0b\u5b89\u5168\u4e0e\u5e76\u53d1\u95ee\u9898<\/strong><\/h2>\n\n\n\n<p>\u5f53\u591a\u4e2a\u7ebf\u7a0b\u5e76\u53d1\u8bbf\u95ee\u5171\u4eab\u8d44\u6e90\u65f6\uff0c\u5fc5\u987b\u786e\u4fdd\u5bf9\u5171\u4eab\u8d44\u6e90\u7684\u8bbf\u95ee\u662f\u7ebf\u7a0b\u5b89\u5168\u7684\u3002\u4f7f\u7528\u4e92\u65a5\u91cf\u3001\u6761\u4ef6\u53d8\u91cf\u3001\u8bfb\u5199\u9501\u7b49\u540c\u6b65\u673a\u5236\u53ef\u4ee5\u907f\u514d\u6570\u636e\u7ade\u4e89\u548c\u6b7b\u9501\u7b49\u95ee\u9898\u3002<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li><strong>\u6b7b\u9501<\/strong>\uff1a\u5f53\u591a\u4e2a\u7ebf\u7a0b\u4e92\u76f8\u7b49\u5f85\u5bf9\u65b9\u91ca\u653e\u8d44\u6e90\u65f6\uff0c\u7a0b\u5e8f\u4f1a\u8fdb\u5165\u6b7b\u9501\u72b6\u6001\u3002\u8981\u907f\u514d\u6b7b\u9501\uff0c\u53ef\u4ee5\u901a\u8fc7\u8bbe\u8ba1\u5408\u7406\u7684\u9501\u987a\u5e8f\u3001\u907f\u514d\u5d4c\u5957\u9501\u7b49\u65b9\u6cd5\u6765\u9632\u6b62\u3002<\/li>\n\n\n\n<li><strong>\u6570\u636e\u7ade\u4e89<\/strong>\uff1a\u591a\u4e2a\u7ebf\u7a0b\u540c\u65f6\u4fee\u6539\u5171\u4eab\u53d8\u91cf\u800c\u6ca1\u6709\u540c\u6b65\u4fdd\u62a4\uff0c\u53ef\u80fd\u5bfc\u81f4\u4e0d\u4e00\u81f4\u7684\u7ed3\u679c\u3002\u901a\u8fc7\u4f7f\u7528\u4e92\u65a5\u91cf\u7b49\u540c\u6b65\u673a\u5236\u53ef\u4ee5\u907f\u514d\u6570\u636e\u7ade\u4e89\u3002<\/li>\n<\/ul>\n\n\n\n<h2 class=\"wp-block-heading\"><strong>5. \u5c0f\u7ed3<\/strong><\/h2>\n\n\n\n<p>C++ \u591a\u7ebf\u7a0b\u7f16\u7a0b\u63d0\u4f9b\u4e86\u5f3a\u5927\u7684\u5de5\u5177\u6765\u5b9e\u73b0\u5e76\u53d1\u548c\u5e76\u884c\u5904\u7406\u3002\u901a\u8fc7\u4f7f\u7528 <code>std::thread<\/code> \u521b\u5efa\u548c\u7ba1\u7406\u7ebf\u7a0b\uff0c\u7ed3\u5408\u4e92\u65a5\u91cf\u3001\u6761\u4ef6\u53d8\u91cf\u7b49\u540c\u6b65\u673a\u5236\uff0c\u53ef\u4ee5\u7f16\u5199\u9ad8\u6548\u4e14\u7ebf\u7a0b\u5b89\u5168\u7684\u7a0b\u5e8f\u3002\u5728\u8fdb\u884c\u591a\u7ebf\u7a0b\u7f16\u7a0b\u65f6\uff0c\u5fc5\u987b\u7279\u522b\u6ce8\u610f\u7ebf\u7a0b\u540c\u6b65\u548c\u5171\u4eab\u8d44\u6e90\u8bbf\u95ee\u7684\u5b89\u5168\u6027\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"<p>C++ \u591a\u7ebf\u7a0b\u7f16\u7a0b\u5141\u8bb8\u7a0b\u5e8f\u5e76\u884c\u6267\u884c\u591a\u4e2a\u4efb\u52a1\uff0c\u8fd9\u6837\u53ef\u4ee5\u6709\u6548\u5730\u5229\u7528\u591a\u6838\u5904\u7406\u5668\uff0c\u63d0\u9ad8\u7a0b\u5e8f\u7684\u6027\u80fd\u548c\u54cd\u5e94\u901f\u5ea6\u3002C++11 [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":3338,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[81],"tags":[],"class_list":["post-3337","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-c-"],"_links":{"self":[{"href":"https:\/\/www.laixuexila.com\/index.php\/wp-json\/wp\/v2\/posts\/3337","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.laixuexila.com\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.laixuexila.com\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.laixuexila.com\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.laixuexila.com\/index.php\/wp-json\/wp\/v2\/comments?post=3337"}],"version-history":[{"count":1,"href":"https:\/\/www.laixuexila.com\/index.php\/wp-json\/wp\/v2\/posts\/3337\/revisions"}],"predecessor-version":[{"id":3339,"href":"https:\/\/www.laixuexila.com\/index.php\/wp-json\/wp\/v2\/posts\/3337\/revisions\/3339"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.laixuexila.com\/index.php\/wp-json\/wp\/v2\/media\/3338"}],"wp:attachment":[{"href":"https:\/\/www.laixuexila.com\/index.php\/wp-json\/wp\/v2\/media?parent=3337"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.laixuexila.com\/index.php\/wp-json\/wp\/v2\/categories?post=3337"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.laixuexila.com\/index.php\/wp-json\/wp\/v2\/tags?post=3337"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}