Practical Uses for the “Curiously Recurring Template Pattern”

后端 未结 5 1569
孤街浪徒
孤街浪徒 2020-11-30 22:47

What are some practical uses for the \"Curiously Recurring Template Pattern\"? The \"counted class\" example commonly shown just isn\'t a convincing example to me.

5条回答
  •  南笙
    南笙 (楼主)
    2020-11-30 23:43

    For a real-world library use of CRTP, look at ATL and WTL (wtl.sf.net). It is used extensively there for compile-time polymorphism.

提交回复
热议问题