()ãé¢æ°å¼ã³åºãæ¼ç®åãé¢æ°ãªãã¸ã§ã¯ã æ¼ç®åã®è¡¨ã¸ ãã¼ã¸ã®å é 㸠() ã¯ãé¢æ°å¼ã³åºãã®æ¼ç®åã§ãããããã¯ã©ã¹å®ç¾©ã®ä¸ã§ãªã¼ãã¼ãã¼ãããã¨ãã¯ã©ã¹ãªãã¸ã§ã¯ãã®å¾ãã« () ãä»ãã¦ãé¢æ°å¼ã³åºãã®å½¢å¼ã§å¼ã³åºããããã«ãªãã¾ãã ã¾ããå®ç¾©ã®ä»æ¹ãè¦ã¦ã¿ã¾ãããã次ã®ä¾ã§ã¯ãæ´æ°ã®å¼æ° iValue ãåããããã 2 åã«ãã¦è¿ãæ¼ç®å () ãå®ç¾©ãã¦ãã¾ãã class CManiac { public: int operator()(int iValue) { return 2 * iValue; } }; 次ã«ãããã使ãå´ã®ä¾ãè¦ã¦ã¿ã¾ãããã int main() { CManiac maniac; // ã¯ã©ã¹ãªãã¸ã§ã¯ã maniac ãä½æããã int iValue = maniac(1); // é¢æ°å¼ã³åºãæ¼ç®å () ã maniac ã«é©ç¨ãã
{{#tags}}- {{label}}
{{/tags}}