1. C++ ãã¬ãŒã ã¯ãŒã¯ã®éžæ
ãã¬ãŒã ã¯ãŒã¯ã¯ããœãããŠã§ã¢éçºã®ã¹ããŒããšå¹çãäžããããã®å€§åãªããŒã«ã§ããããã®éžæã¯éåžžã«éèŠã§ãããã®éžæã誀ããšããããžã§ã¯ãã®éçºé床ãå質ã«å€§ããªãã¬ãã£ããªåœ±é¿ãåãŒãå¯èœæ§ããããŸããããã§ã¯ãC++ãã¬ãŒã ã¯ãŒã¯ã®éžæã«ã€ããŠè©³ããèŠãŠãããŸãããã
1.1 C++ ãã¬ãŒã ã¯ãŒã¯ã®çš®é¡ãšç¹åŸŽ
æ§ã
ãªC++ãã¬ãŒã ã¯ãŒã¯ãååšããŸãããããããã«ã¯ç¬èªã®ç¹æ§ãå©ç¹ããããŸããäŸãã°ãQtã¯ãŠãŒã¶ãŒã€ã³ã¿ãŒãã§ãŒã¹ã®èšèšã«åªãããã¬ãŒã ã¯ãŒã¯ã§ãããBoostã¯é«åºŠãªæ©èœãæäŸããŠããŸãã
äžæ¹ãPocoã¯è»œéã§ãé«åºŠãªããã©ãŒãã³ã¹ãå¿
èŠãšããã¢ããªã±ãŒã·ã§ã³ã«é©ããŠããŸãã
ãã®ä»ã®æåãªãã¬ãŒã ã¯ãŒã¯ã«ã¯ãACEïŒAdaptive Communication EnvironmentïŒãJUCEãªã©ããããŸãããããã®ãã¬ãŒã ã¯ãŒã¯ã¯ããŠã§ãããŒã¹ã®ã¢ããªã±ãŒã·ã§ã³ããã¹ã¯ãããã¢ããªã±ãŒã·ã§ã³ãé³æ¥œãœãããŠã§ã¢ããããã¯ãŒãã³ã°ãšãã£ãå¹ åºãçšéã«å©çšãããŠããŸãã
åãã¬ãŒã ã¯ãŒã¯ã®ç¹æ§ãç解ããŠããããžã§ã¯ãã®èŠä»¶ã«æãé©ãããã®ãéžæããããšãéèŠã§ãã
1.2 ãã¬ãŒã ã¯ãŒã¯éžæã®èŠç¹
ãã¬ãŒã ã¯ãŒã¯ãéžæããéã«ã¯ã以äžã®èŠç¹ãèæ ®ãããšè¯ãã§ãããã
åãã«ããã¬ãŒã ã¯ãŒã¯ãæäŸããæ©èœãšãããžã§ã¯ãã®èŠä»¶ãäžèŽããã確èªããŸãããŸãããã¬ãŒã ã¯ãŒã¯ã®ããã©ãŒãã³ã¹ãã¡ã¢ãªæ¶è²»éãäŸåæ§ãªã©ãè©äŸ¡ã®ãã€ã³ããšãªããŸãã
次ã«ããã¬ãŒã ã¯ãŒã¯ã®ããã¥ã¡ã³ããŒã·ã§ã³ã®è³ªãã³ãã¥ããã£ã®æŽ»æ§åºŠã確èªãããµããŒãããã©ãã«ã·ã¥ãŒãã£ã³ã°ã«åœ¹ç«ã€æ å ±ã容æã«å ¥æã§ãããè©äŸ¡ããŸãã
1.3 åãã¬ãŒã ã¯ãŒã¯ã®è©äŸ¡åºæº
ãã¬ãŒã ã¯ãŒã¯ãè©äŸ¡ããéã«ã¯ã以äžã®åºæºãäžè¬çã§ãã
ïŒã€ç®ã¯æ©èœæ§ã§ããã®ãã¬ãŒã ã¯ãŒã¯ãç®çã«æ²¿ã£ãæ©èœãæäŸãããã©ããã確èªããŸããæŽã«ããã®æ©èœãå¹ççã§é«éã«åäœããããéèŠã§ãã
ïŒã€ç®ã¯ã¡ã³ããã³ã¹æ§ã§ããã¬ãŒã ã¯ãŒã¯ã®ã¢ããããŒãã容æã§ããããšãåã³ãã®ãã¬ãŒã ã¯ãŒã¯ã§éçºããããœãããŠã§ã¢ãå°æ¥ãç¶æ管çã§ããããæ€èšããŸãã
1.4 åã¯æ¥ãïŒC++ ãã¬ãŒã ã¯ãŒã¯éžã³ã®ãã€ã³ã
ãã¬ãŒã ã¯ãŒã¯ãéžæããéãæ£ããéžæãæ¥ãããšãéèŠã§ãããã®çç±ã¯ããã¬ãŒã ã¯ãŒã¯ã¯ãããžã§ã¯ãã®åºç€ãšãªããããåæ段éã§æ£ããéžæãè¡ããªããšåŸããå€æŽããã®ãå°é£ã ããã§ãã
æçµçã«ã¯ãæ©èœæ§ãããã©ãŒãã³ã¹ãã¡ã³ããã³ã¹æ§ããããŠå°æ¥ã®ã¹ã±ãŒã©ããªãã£ãç·åçã«è©äŸ¡ããŠãæé©ãªãã¬ãŒã ã¯ãŒã¯ãéžæããããšãéèŠã§ãã
ãããã®èæ ®ç¹ãèžãŸããå°é家ã®æèŠãã¬ãã¥ãŒãåèã«ããªãããããªãã®ãããžã§ã¯ãã«æé©ãªC++ãã¬ãŒã ã¯ãŒã¯ãéžæããŠãã ããã
2. ãã¬ãŒã ã¯ãŒã¯èšå®ã®åºç€
ãã¬ãŒã ã¯ãŒã¯ã䜿ãããšã§ãC++ã®ã³ãŒãã£ã³ã°ãå€§å¹ ã«å¹çåãããŸãããã ãããã¬ãŒã ã¯ãŒã¯ãæ倧éã«çããããã«ã¯ãé©åãªèšå®ãå¿ èŠãšãªããŸããããã§ã¯ãèšå®ã®åºç€ã解説ããŸãã
èšå®ã¯ãœãããŠã§ã¢éçºã®åæ段éã§è¡ãããéèŠãªããã»ã¹ã§ãããããæ£ããèšå®ãããŠããªããšãæ¬æ¥çæéã§çµããäœæ¥ãäºæããªãåé¡ã«ããé 延ããããšããããŸãã
ããããèšå®æ¹æ³ã®è©³çŽ°ãèšå®ã®ããã»ã¹ããããããšã©ãŒãšãã®è§£æ¶æ³ã䟿å©ãªèšå®ããŒã«ã«ã€ããŠèª¬æããŸãã
2.1 ãã¬ãŒã ã¯ãŒã¯èšå®ã®æºå
æåã«ãå¿ èŠãªãœãããŠã§ã¢ãšã©ã€ãã©ãªãæãããã¬ãŒã ã¯ãŒã¯ãæ£åžžã«åäœããç°å¢ãæŽããŸããOSãä»ã®ãœãããŠã§ã¢ãšã®äºææ§ãèæ ®ããŸãã
次ã«ããã¬ãŒã ã¯ãŒã¯ã®ããŒãžã§ã³ãéžã³ãŸããææ°çã䜿çšããã®ãäžè¬çã§ãããç¹å®ã®æ©èœãå¿ èŠãªå Žåãäºææ§ã®åé¡ãããå Žåã¯ãé©ããããŒãžã§ã³ãéžæããŸãã
æºåäœæ¥ã¯æéããããéšåããããŸããããã®äœæ¥ã«ããåŸã®éçºäœæ¥ã®å¹çåãåé¡ã®æªç¶é²æ¢ã«ç¹ããããéèŠã§ãã
2.2 ãã¬ãŒã ã¯ãŒã¯èšå®ã®ããã»ã¹
èšå®ããã»ã¹ã¯ãã¬ãŒã ã¯ãŒã¯ã®çš®é¡ã«ããç°ãªããŸãããäžè¬çãªæµãã¯ä»¥äžã®éãã§ãã1. ãã¬ãŒã ã¯ãŒã¯ã®ã€ã³ã¹ããŒã« 2. èšå®ãã¡ã€ã«ã®äœæã»ç·šé 3. ããŒã¿ããŒã¹ã®èšå® 4. ãµãŒããŒã®èšå®ã§ãã
ãªããèšå®ã¯å¿ èŠã«å¿ããŠå€æŽããããšãå¯èœã§ãããã ããåºæ¬çã«ã¯éçºåæã«äžåºŠé©åã«èšå®ããã°ããã®åŸå€æŽããå¿ èŠã¯å°ãªãã§ãããã
以äžããã¬ãŒã ã¯ãŒã¯èšå®ã®åºæ¬çãªããã»ã¹ã§ããèšå®ããã»ã¹ãç解ããã°ãèšå®ã®å€æŽããã©ãã«çºçæã®å¯Ÿå¿ã容æã«ãªããŸãã
2.3 ããããèšå®ãšã©ãŒãšãã®è§£æ±ºæ¹æ³
èšå®ãšã©ãŒã¯éçºãå€§å¹ ã«é ãããåå ãšãªããŸãããããããšã©ãŒãšãã®è§£æ±ºæ¹æ³ã解説ããŸãã
ãšã©ãŒã®äžäŸãšããŠã¯ããèšå®ãã¡ã€ã«ã®èšè¿°ãã¹ãããããŸããããã¯èšè¿°å 容ããã©ãŒãããã«åé¡ãããå Žåã«èµ·ããŸãããã®ãšã©ãŒã¯èšå®ãã¡ã€ã«ã確èªããé©åãªèšè¿°ã«ä¿®æ£ããããšã§è§£æ±ºããŸãã
ãŸãããã©ã€ãã©ãªã®äºææ§åé¡ããããèŠããããšã©ãŒã§ããããã¯ç¹å®ã®ã©ã€ãã©ãªãã€ã³ã¹ããŒã«ããåŸã«ãã¬ãŒã ã¯ãŒã¯ãæ£åžžã«åäœããªããªãå Žåã«çºçããŸãã解決æ¹æ³ã¯ã©ã€ãã©ãªãé©åãªããŒãžã§ã³ã«æŽæ°ããã°ã倧æµæ£åžžã«æ»ããŸãã
2.4 䟿å©ãªãã¬ãŒã ã¯ãŒã¯èšå®ããŒã«
ãã¬ãŒã ã¯ãŒã¯ã®èšå®ãå©ããããŒã«ãååšããŸãããããã®ããŒã«ãå©çšããããšã§ãèšå®äœæ¥ã®å¹çåããã¹ã®åæžãæåŸ ã§ããŸãã
äŸãã°ã“Configurator”ãšããããŒã«ã¯ããã¬ãŒã ã¯ãŒã¯ã®èšå®ãã¡ã€ã«ãçŽæçã«çæã»ç®¡çããããšãå¯èœã§ããããã«ãããèšå®ãã¹ãæªç¶ã«é²ãããšãå¯èœã§ãã
ãŸãã“Checker”ãšããããŒã«ã¯ãèšå®ãã¡ã€ã«ã®èšè¿°ãã¹ããã§ãã¯ãããã¹ãçºèŠããå Žåå³æã«éç¥ããŸããããã«ãããèšå®äœæ¥ã®æ£ç¢ºæ§ãåäžããŸãã
3. C++ ãã¬ãŒã ã¯ãŒã¯ã§ã®éçºæ¹æ³
æ®ã©ã®ãœãããŠã§ã¢ãããžã§ã¯ãã«ãããŠããã¬ãŒã ã¯ãŒã¯ã®éžæã¯éåžžã«éèŠãªææ決å®ã®1ã€ã§ãããããããã®éçºæ¹æ³ã¯ãããžã§ã¯ãã®æ§è³ªãç®çãã¹ãã«ã»ããã«å€§ããäŸåããŸããC++ãã¬ãŒã ã¯ãŒã¯ã䜿çšããéã®åºæ¬ãšãªãéçºæ¹æ³ã«ã€ããŠæãäžããŠãããŸãã
3.1 éçºç°å¢ã®éžæãšèšå®
é©åãªéçºç°å¢ãéžã¶ããšã¯ãC++ ãã¬ãŒã ã¯ãŒã¯ã§ã®éçºäœæ¥ãåæ»ã«é²ããããã®ç¬¬äžæ©ã§ãã
IDEïŒçµ±åéçºç°å¢ïŒã¯ã³ãŒããšãã£ã¿ãã³ã³ãã€ã©ããããã¬ãŒãªã©ãããã±ãŒãžåãããŠããéçºããŒã«ã§ãVisual StudioãEclipseãªã©ããã®äŸã§ãããã®ä»ã«ãæ軜ã§å€æ©èœãªVSCodeãéçºè ã«æçšãããŠããŸãã
éžæããç°å¢ã«ãããC++ ãã¬ãŒã ã¯ãŒã¯ã®èšå®æ¹æ³ãç°ãªãã®ã§ãå°å ¥ããèšå®ãŸã§ã®ããã¥ã¡ã³ããŒã·ã§ã³ã確èªããããšã匷ãæšå¥šããŸãã
3.2 C++ ãã¬ãŒã ã¯ãŒã¯ã«ããããã°ã©ã æ§é
C++ãã¬ãŒã ã¯ãŒã¯ã䜿çšãããšãã¢ããªã±ãŒã·ã§ã³ã®åºæ¬çãªæ§é ãèšèšã«é¢ããæéãæäŸãããŸãããããã¯ããã°ã©ã å šäœã®æ§é ãèšèšãçµç¹åããç¶æã»ç®¡çã容æã«ããããã§éèŠã§ãã
äŸãã°ãC++ã®ãã¬ãŒã ã¯ãŒã¯ã§ããQtã§ã¯ãGUIããã°ã©ãã³ã°ãšã€ãã³ãé§åããã°ã©ãã³ã°ãäž»ãªç¹æ§ãšããŠæäŸãããå©çšè ã«ã·ã¹ãã ã®æ§é èšèšãå©ããŸãã
ãã¬ãŒã ã¯ãŒã¯ã«ããããã°ã©ã æ§é èšèšã«ã€ããŠç解ããããšã¯ããœãããŠã§ã¢éçºã®è³ªãé«ããäžã§ã倧å€éèŠãªèŠçŽ ã§ãã
3.3 ãããã°ãšãã¹ãã®åºæ¬
éçºéçšã§çãããšã©ãŒããã°ã®æé€ã¯å¿ é ã§ãããããã°ããŒã«ãšãã¹ããã¬ãŒã ã¯ãŒã¯ã䜿çšããããšã§ãããã®äœæ¥ãåçåã§ããŸãã
å€ãã®C++ãã¬ãŒã ã¯ãŒã¯ã¯ãããã°ããŒã«ããã¹ããã¬ãŒã ã¯ãŒã¯ãæäŸãããã¯ãµããŒãããŠããã®ã§ããã®æ©èœãšäœ¿çšæ³ã«ã€ããŠç解ãæ·±ããããšãéèŠã§ãã
äŸãã°ãGoogle TestãCatchãªã©ã®ãã¹ããã¬ãŒã ã¯ãŒã¯ã¯ãC++ã®éçºã«ããããã¹ãèªååã«åœ¹ç«ã¡ãŸããããã«ãããã³ãŒãã®æ£åžžæ§ç¢ºèªãè¿ éãã€å®¹æã«è¡ãããšãå¯èœã«ãªããŸãã
3.4 ãã¬ãŒã ã¯ãŒã¯ã掻çšããå¹ççãªã³ãŒãã£ã³ã°
C++ãã¬ãŒã ã¯ãŒã¯ã䜿çšããæ倧ã®å©ç¹ã®1ã€ã¯ãäžè²«æ§ã®ããã¢ãŒããã¯ãã£ã«æ²¿ã£ãŠã³ãŒããæžããç¹ã§ããããã«ããããã¬ãŒã ã¯ãŒã¯ã®èŠåããã¹ããã©ã¯ãã£ã¹ã«åŸã£ãŠããã°ã©ãã³ã°ãè¡ããŸãã
ã³ãŒãã£ã³ã°ã¹ã¿ã€ã«ãåœåèŠåããã¶ã€ã³ãã¿ãŒã³ãªã©ããã¬ãŒã ã¯ãŒã¯ç¹æã®èŠçŽãç解ã掻çšããããšã§ãã³ãŒãã®å¯èªæ§ãä¿å®æ§ãåäžãããããšãå¯èœã§ãã
ãããã®èŠçŽ ãå¹æçã«å©çšããããšã§ãC++ãã¬ãŒã ã¯ãŒã¯ã®åãæ倧éã«åŒãåºãããšãå¯èœã«ãªãã§ãããã
4. ãã¬ãŒã ã¯ãŒã¯ã«ãããããžã§ã¯ãå±é
ããã§ã¯ãC++ãã¬ãŒã ã¯ãŒã¯ã«ãããããžã§ã¯ãå±éã®éèŠæ§ã«ã€ããŠè©³ãã解説ããŸãããã¬ãŒã ã¯ãŒã¯ãå·Šæã«ãææç©ãå³æã«ãããªããèªæµ·ã®ææ®è ãšãªã£ãŠè¿·å®®ãžãšé²ãã®ã§ãã
ãã¬ãŒã ã¯ãŒã¯ãçšããå©ç¹ãšããŠã¯ãã³ãŒãã®å質ãåäžããæéãšã³ã¹ããåæžãããããšãããã«ã¯æ°ããå ¥ã£ãéçºè ã§ãç解ãããããããžã§ã¯ãã®æ§é ãã€ãããããããšãæããããŸãã
ãŸããå®å®æ§ããœãããŠã§ã¢ã®å¯¿åœããã¬ãŒã ã¯ãŒã¯ã®éžæã«ãã£ãŠå€§ãã圱é¿ãããŸããé©åãªãã¬ãŒã ã¯ãŒã¯ãéžæããããšã§ããœãããŠã§ã¢ã¯ããé·ãéãããé«ãããã©ãŒãã³ã¹ã§åäœããå¯èœæ§ããããŸãã
4.1 ãããžã§ã¯ã管çã®åºæ¬
ãããžã§ã¯ã管çã®åºæ¬ãšã¯äœããããããã¬ãŒã ã¯ãŒã¯ã®èŠç¹ããå€æããããã«ã¯ã©ããããããã®ãã«ã€ããŠèããŠã¿ãŸãããããããžã§ã¯ã管çã«ãšã£ãŠéèŠãªã®ã¯å¹çãšçµç¹ã§ãã
ãã¬ãŒã ã¯ãŒã¯ã¯éçºè ããåçºæã®è»èŒªããäœãå¿ èŠãªããåºæ¬çãªã³ã³ããŒãã³ããæäŸããŸããããã§æéãå€§å¹ ã«ç¯çŽããéçºè ãç¹å®ã®åé¡ã«çŠç¹ãåœãŠãããšãã§ããŸãã
ãŸããããŒã å šäœãäžè²«ããã³ãŒãæ§é ãæã€ããšã§ãä»ã®éçºè ããããžã§ã¯ããç解ããããããŸããããã«ãããããæ©ãæ°ããæ©èœãéçºããããšãå¯èœãšãªããŸãã
4.2 ããŒã éçºã§ã®ãã¬ãŒã ã¯ãŒã¯ã®æŽ»çš
ããŒã ã®éçºç°å¢ã§ã¯ããã¬ãŒã ã¯ãŒã¯ã¯ããã«éèŠæ§ãå¢ããŸãããã倧èŠæš¡ãªãããžã§ã¯ãã§ã¯ããã®ãã¬ãŒã ã¯ãŒã¯ãåŠäœã«å¹ççãããããŠã³ãŒãã®äžè²«æ§ãä¿ã€ããéåžžã«éèŠã§ãã
äžè²«æ§ã®ããã³ãŒãããŒã¹ã¯ããã¬ãŒã ã¯ãŒã¯ã®æäŸããäžè²«ããæ§é ã®ãããã§ãããããããŒã ã¡ã³ããŒããããžã§ã¯ãå šäœãç解ãããããªããŸããã³ãŒãèšèšã®äžè²«æ§ã¯ãæ°ã¡ã³ããŒã®å°å ¥ããããžã§ã¯ãéã®ç§»åãåæ»ã«å©ããŸãã
ãŸãããã¬ãŒã ã¯ãŒã¯ã¯ç¹å®ã®åé¡ã«çŠç¹ãåœãŠãããšãã§ããéçºãµã€ã¯ã«ã®ççž®ãå質ã®åäžããããªãå¹çåã«ã€ãªãããŸãã
4.3 ãã«ããšãããã€ã®æµã
ãããžã§ã¯ãã®ãã«ããšãããã€ã®æµããç解ããããšãéèŠã§ãããã®ããã»ã¹ãç解ããããšã«ããããããã°ããã¹ãããããã€ãè¿ éãã€å¹ççã«è¡ããŸãã
åãã¬ãŒã ã¯ãŒã¯ã«ã¯ããã«ãããã»ã¹ã管çããã³ãŒããæ£åžžã«ã³ã³ãã€ã«ãå®è¡å¯èœãªãœãããŠã§ã¢ã«å€æããããã®èªå·±å®çµçãªããŒã«ãå«ãŸããŠããŸããããã«ããããã«ãããã»ã¹ãç°¡çŽ åãããããŒã ã¯ããçãæéã§çµæãåŸãããšãå¯èœã«ãªããŸãã
åæ§ã«ããã¬ãŒã ã¯ãŒã¯ã¯ãããã€ã¡ã³ãã®ããã»ã¹ãç°¡åã«ããŸããAutonomous Continuous DeploymentããŒã«ãªã©ã§ããããžã§ã¯ãã¯è¿ éãã€å¹ççã«ãããã€ã§ããŸãã
4.4 ãã¬ãŒã ã¯ãŒã¯éžæããå®æãŸã§ã®ã¿ã€ã ã©ã€ã³
ãã¬ãŒã ã¯ãŒã¯éžæã®åæ段éãããœãããŠã§ã¢å®æãŸã§ã®ã¿ã€ã ã©ã€ã³ã¯ããããžã§ã¯ãã®ãªãŒãã¿ã€ã ãå€§å¹ ã«åæžããŸãããã¬ãŒã ã¯ãŒã¯ãéžæããããšã§ãäŒç»ãèšèšããã³éçºæéãå€§å¹ ã«ççž®ãããŸãã
å¿ èŠãªæ©èœããã¬ãŒã ã¯ãŒã¯ã«å«ãŸããŠããã°ããã®éçºæéã¯èããæžå°ããŸããé©åãªãã¬ãŒã ã¯ãŒã¯ã®éžæã«ãããéçºè ã¯ãœãããŠã§ã¢ã®çŽ æ©ããããã¿ã€ãã³ã°ã«å°å¿µããããšãã§ããŸãã
ãã®ã¿ã€ã ã©ã€ã³ã®æåŸã«ã¯ããã¬ãŒã ã¯ãŒã¯ã«åºã¥ããœãããŠã§ã¢ã®ãã¹ããšã®ããã»ã¹ã次ã«ç¶ããŸãããã¬ãŒã ã¯ãŒã¯ã䜿çšãããšãäžè²«æ§ã®ããçµæãšä¿¡é Œæ§ã®é«ããœãããŠã§ã¢ãåŸãããŸãã
5. ãã¹ããã©ã¯ãã£ã¹ãšãã©ãã«ã·ã¥ãŒãã£ã³ã°
ããã§ã¯ãC++ ãã¬ãŒã ã¯ãŒã¯ã䜿çšããéã®ãã¹ããã©ã¯ãã£ã¹ãšäžè¬çãªåé¡ã«ã€ããŠããããŠããããåŠäœã«è§£æ±ºãããã«ã€ããŠèå¯ããŸãã
5.1 æåäºäŸããåŠã¶ãã¹ããã©ã¯ãã£ã¹
ãŸãã¯æåäºäŸããåŠã¶ããšã§ããã¬ãŒã ã¯ãŒã¯ãçšããéçºå¹çãæ倧åããäºæããªã課é¡ãã身ãå®ãããšãå¯èœã«ãªããŸãã人ã ãäœãããŠæåããŠããã®ããèŠãŠåŠã¶ããšã¯ãæã ãç¯ãå¯èœæ§ã®ããéã¡ãé¿ãã倧ããªäžæ©ãšãªããŸãã
æåãªC + +ãããžã§ã¯ãã®æåäºäŸãåç §ããããšã§ãå¿ èŠãªã³ã³ããŒãã³ããšæ§æãé©åãªãã¶ã€ã³ãã¿ãŒã³ããã®ä»ã®ãã¹ããã©ã¯ãã£ã¹ãç解ããããšãã§ããŸãã
ããã«ãæåäºäŸãåŠã¶ããšã§ãã©ã®ãããªç¶æ³ã§ãã©ã®ãã¬ãŒã ã¯ãŒã¯ãæãå¹æçã§ããããç解ããèªèº«ã®ãããžã§ã¯ãã«æé©ãªããŒã«ãéžæããæå©ããšãªããŸãã
5.2 C++ ãã¬ãŒã ã¯ãŒã¯ã§ééããäžè¬çãªåé¡
次ã«ãC++ ãã¬ãŒã ã¯ãŒã¯ã䜿çšããéã«ééããäžè¬çãªåé¡ãèŠãŠãããŸããäžè¬çã«ãã¡ã¢ãªç®¡çãããã©ãŒãã³ã¹ãäºææ§ãäŸåæ§ç®¡çãªã©ãäž»ãªèª²é¡ãšãªã£ãŠããŸãã
ãã¬ãŒã ã¯ãŒã¯ã®äœ¿çšã¯å€§å¹ ã«çç£æ§ãåäžãããŸãããããã«ã¯èªèº«ã§æãå ããäœå°ãå¶éãããšãã代åãã€ããŠããŸãããã®ããããã¬ãŒã ã¯ãŒã¯å ã§çºçããåé¡ãå¹æçã«è§£æ±ºããããã®æ·±ãç解ãæ±ããããŸãã
ãŸãããã¬ãŒã ã¯ãŒã¯ã®éããç解ããããããã®åŒ·ã¿ãšåŒ±ã¿ãææ¡ããããšãéèŠã§ããããããã®ãã¬ãŒã ã¯ãŒã¯ã«ã¯ç¹å®ã®ãŠãŒã¹ã±ãŒã¹ã«å¯Ÿããæé©ãªè§£æ±ºçãæäŸããããã®èšèšææ³ããããŸãã
5.3 ãã©ãã«ã·ã¥ãŒãã£ã³ã°ã®ã¹ããã
代衚çãªãã©ãã«ã·ã¥ãŒãã£ã³ã°ã®ã¹ãããã«ã€ããŠèŠãŠãããŸãããããŸããåé¡ãæ確ã«å®çŸ©ããç¶æ³ãææ¡ããããšãæåã®ã¹ãããã§ãã次ã«ããã®åé¡ããã¬ãŒã ã¯ãŒã¯åºæã®ãã®ãªã®ãããããã¯äžè¬çãªC++ã®åé¡ãªã®ããå€æããŸãã
åé¡ããã¬ãŒã ã¯ãŒã¯ã®ãŸã£ããå¶åŸ¡ã§ããªãéšåã§åçŸããããšãã§ããã°ãããã¯C++èªäœã®åé¡ã§ããå¯èœæ§ãé«ãã§ãããªã³ã©ã€ã³ã§ã®æ å ±æ€çŽ¢ããªãã£ã·ã£ã«ããã¥ã¡ã³ããŒã·ã§ã³ã®åç §ãã³ãã¥ããã£ã«è³ªåãããªã©ã®æ段ãéããŠåé¡ã解決ããŸãã
ãŸãããã¬ãŒã ã¯ãŒã¯åºæã®åé¡ã®å Žåã¯ããã®ãã¬ãŒã ã¯ãŒã¯ã®ããã¥ã¡ã³ããŒã·ã§ã³ãã³ãã¥ããã£ãã©ãŒã©ã ã§æ¢ç¥ã®åé¡ãšå¯ŸåŠæ³ãæ¢ããŸãã
5.4 ãã¬ãŒã ã¯ãŒã¯ã®æ¥æïŒããããèœãšãç©Žãšåé¿ç
æåŸã«ãC++ãã¬ãŒã ã¯ãŒã¯ã®ããããèœãšãç©Žãšãããåé¿ããããã®çç¥ã«ã€ããŠã¿ãŠãããŸãããã
äŸãã°ããããããšã©ãŒãšããŠãå éšçãªå«æããç解ããã«ã³ãŒããæžããšãããã®ããããŸããã€ãŸãããã¬ãŒã ã¯ãŒã¯ãæäŸãã䟿å©ãªæ©èœãå©çšããããšã«ãããäœãèµ·ãã£ãŠããã®ãç解ããªããŸãŸé²ããŠããŸãããšã§ãã
ããã«å¯Ÿããäžã€ã®è§£æ±ºçã¯ããã¬ãŒã ã¯ãŒã¯ã®åºæ¬çãªä»çµã¿ãç解ããããšã§ããã©ã®ããã«ã¡ã¢ãªãå²ãåœãŠãããã©ã®ããã«åäœããŠããã®ãããããŠããããªãéèŠãªã®ããææ¡ããããšãéèŠã§ãã
6. ãã¬ãŒã ã¯ãŒã¯å°å ¥åŸã®ã¡ã³ããã³ã¹ãšã¢ããããŒã
ãã¬ãŒã ã¯ãŒã¯ãå°å ¥ãããåŸã«é©åãªä¿å®ã»ã¡ã³ããã³ã¹ãšã¢ããããŒããå®è¡ãããªããã°ããã®ããã©ãŒãã³ã¹ãå¹çæ§ã¯ç¶æã§ããŸããããã®ãããä»åã®ã»ã¯ã·ã§ã³ã§ã¯ããã¬ãŒã ã¯ãŒã¯ã®ã¡ã³ããã³ã¹ãšã¢ããããŒãã«ã€ããŠå ·äœçã«èšè«ããŸãã
確èªããªããã°ãªããªãèŠçŽ ã§ã¯ãã¢ããããŒãæ¹æ³ãšãã®é©çšããã¬ãŒã ã¯ãŒã¯ã®ã¢ããããŒãã«é¢é£ãããªã¹ã¯ããããŠãªã¹ã¯å¯ŸçããããŸãã
ãããã®ç¥èã身ã«ã€ããããšã§ããã¬ãŒã ã¯ãŒã¯ã®ç¶ç¶çãªããã©ãŒãã³ã¹ã確ä¿ããéçºãããžã§ã¯ãã®ææãæ倧åããããšãã§ããŸãã
6.1 ã¡ã³ããã³ã¹ã®éèŠæ§
ãã¬ãŒã ã¯ãŒã¯ã®ã¡ã³ããã³ã¹ã¯ããã¬ãŒã ã¯ãŒã¯ãæã€å šãŠã®ç¹æ§ãç¶æãã極åããã©ãŒãã³ã¹ã®äœäžãé²ãããã«éèŠã§ãããã¬ãŒã ã¯ãŒã¯ãã¡ã³ããã³ã¹ããããšã§ãå®å®æ§ãšå¹çæ§ãä¿ã€ããšãã§ããŸãã
ãã¬ãŒã ã¯ãŒã¯ã®ã¡ã³ããã³ã¹ã«ã¯ãå®æçãªã¢ããããŒãã®ç¢ºèªãåé¡è§£æ±ºã®ããã®ãããã®é©çšããããŠæ°ããæ©èœãæ¹åç¹ã®çµ±åãå«ãŸããŸãã
ãããã®æé ãå®æçã«å®è¡ããããšã§ããã¬ãŒã ã¯ãŒã¯ã¯åžžã«ææ°ã®ç¶æ ãä¿ã€ããšãã§ããåŸã£ãŠããããžã§ã¯ãã®å¹çæ§ãšåµé æ§ãç¶æãããŸãã
6.2 ãã¬ãŒã ã¯ãŒã¯ã®ã¢ããããŒãæ¹æ³
äžå ·åã®ä¿®æ£ãæ°æ©èœã®è¿œå ãã»ãã¥ãªãã£äžã®åé¡ã®è§£æ±ºãªã©ãããŸããŸãªçç±ãããã¬ãŒã ã¯ãŒã¯ã®ã¢ããããŒãã¯é »ç¹ã«æäŸãããŸããæŽæ°æ¹æ³ã¯ãã¬ãŒã ã¯ãŒã¯ããšã«ç°ãªããããå ·äœçãªæé ã¯ããã¥ã¡ã³ããŒã·ã§ã³ãŸãã¯å ¬åŒãŠã§ããµã€ããåç §ããããšããå§ãããŸãã
ããããäžè¬çã«ã¯ãæ¢åã®ãã¬ãŒã ã¯ãŒã¯ãã¡ã€ã«ãæ°ããããŒãžã§ã³ã«çœ®ãæããããšã§ã¢ããããŒããè¡ãããŸããæ°ãããã¡ã€ã«ã¯å ¬åŒãŠã§ããµã€ããŸãã¯å°çšã®ããã±ãŒãžãããŒãžã£ããããŠã³ããŒãã§ããŸãã
ã¢ããããŒãããåŸã¯ãå¿ é ã§æ°ããŒãžã§ã³ã®åäœç¢ºèªãè¡ããæ©èœããããšã匷ãæšå¥šããŸãã
6.3 æ¢åãããžã§ã¯ããžã®ãã¬ãŒã ã¯ãŒã¯ã®æŽæ°
æ¢åãããžã§ã¯ãã«å¯Ÿãããã¬ãŒã ã¯ãŒã¯ã®æŽæ°ã¯ãç¹ã«æ³šæãæãã¹ãé åã§ããã¢ããããŒãã¯ãäºæããªãåé¡ãåŒãèµ·ããå¯èœæ§ãããããã§ãã
ãã®ãããæŽæ°ããããã¬ãŒã ã¯ãŒã¯ã®äºææ§ãèŠæ¥µãã圱é¿ãåãããšãªã¢ãäºæž¬ãããªã¹ã¯ãè©äŸ¡ããããšãéèŠã§ããããã«ãã¢ããããŒãã®ååŸã§ããŒã¿ã®ããã¯ã¢ããã確ä¿ããããšãéèŠãªã¹ããããšãªããŸãã
æåŸã«ãæ°ãããã¬ãŒã ã¯ãŒã¯ã«æŽæ°ããåãšåŸã§ãããžã§ã¯ãã®è©³çŽ°ãªæ¯èŒãè¡ããåé¡ãçºçããå Žåã¯éããã«å¯Ÿå¿ããããšãéèŠã§ãã
6.4 ãã¬ãŒã ã¯ãŒã¯ã¢ããããŒãã®ãªã¹ã¯ãšãã®å¯Ÿç
ãã¬ãŒã ã¯ãŒã¯ã®ã¢ããããŒãã¯ãæ°ããæ©èœãšä¿®æ£ãããããäžæ¹ã§ãæ°ããªåé¡ãåŒãèµ·ããå¯èœæ§ããããŸããç¹ã«ãäºææ§ã®åé¡ãã¢ããããŒãã®ãã°ããã®ã«ããŽãªã«è©²åœããŸãã
ãã®ãããã¢ããããŒãåã«ã¯å šãŠã®å€æŽã確èªããå¯èœãªãªã¹ã¯ãè©äŸ¡ããããšãéèŠã§ãããŸããã¢ããããŒãåŸã«å šäœçãªãã¹ããå®è¡ããããšã§ãåé¡ãæ©ã段éã§ç¹å®ã§ããŸãã
ããã«ãã¢ããããŒãåŸã«æ©æ¥ã«å¯Ÿå¿ããããã«ã¯ããã¬ãŒã ã¯ãŒã¯ã®ã¢ããããŒãã现éšãŸã§è¿œè·¡ãããªãªãŒã¹ããŒãã綿å¯ã«èªãããšãéèŠãšãªããŸãã