C++ ã® string 㨠vector ã® reserve() ã®æå C++ ã® string 㨠vector ã«ã¯åãã£ã¦å®¹éã確ä¿ããããã® reserve() ã¨ããã¡ã³ãé¢æ°ãããã¾ããä½æ°ãªã使ã£ã¦ããé¢æ°ã§ããæè¿ã«ãªã£ã¦èå³æ·±ãæåã«æ°ã¥ãã¾ããã reserve() ã®åºæ¬ string 㨠vector ã® reserve() ã¯åãã£ã¦å®¹é (capacity) ã確ä¿ãã¦ããããã®ã¡ã³ãé¢æ°ã§ããåãã£ã¦å®¹éãç¢ºä¿ (reserve) ãã¦ããã°ããã¼ã¿ã®è¿½å æã«çºçããåå²ãå½ã¦ (reallocation) ãé²ããã¨ãã§ããå¹ççã§ãã ãã¨ãã°ãä½ãããªãã§æååã« 1,000æå追å ããå ´åãï¼å é¨çã«åã ã§å®¹éãå¢ããã¦ããããï¼10åç¨åº¦ã®åå²ãå½ã¦ãçºçãã¾ããã s.reserve(1000) ã®ããã«å®¹éã確ä¿ãã¦ããã° 1åã®å²ãå½ã¦ (
{{#tags}}- {{label}}
{{/tags}}