å¹½éå(Phantom Type)ã¨ããã®ãããã¾ãããã®ååã¯Haskellç±æ¥ãªã®ã§ãããC++ã§ã使ãã¾ãã ç§ã以åä½ã£ããæµ®åå°æ°ç¹æ°ã¨æ´æ°ã®strong typedefãã§ã使ã£ã¦ããã®ã§ããã以ä¸ã®ãããªããåãã©ã¡ã¼ã¿ã®å®£è¨ã«ã¯ç¾ããããå®ç¾©ã§ã¯ä½¿ç¨ãããªãåããå¹½éåã¨å¼ã³ã¾ãã template <class FloatingPoint, class Tag> // Tagã¯å é¨ã§ã¯ä¸å使ããªã class tagged_real { FloatingPoint value_; }; åãã©ã¡ã¼ã¿ã®ç°ãªãåã¯ãå¥ãªåã¨è¦ãªãããã®ã§ããããå©ç¨ãã¦ã³ã³ãã¤ã«æã®åãã§ãã¯ãå¼·åããã®ã«ä½¿ç¨ãã¾ãã ãã®ä¾ã§ã¯ãtagged_realã¨tagged_realã®ãããªãç¨éã®ç°ãªãåå士ã®ãæé»ã®åå¤æãç¦æ¢ããã®ã«ä½¿ç¨ãã¦ãã¾ãã ãã®ä¾ã«éãããC++ã®ã¿ã°ãã£ã¹ããã
{{#tags}}- {{label}}
{{/tags}}