On Feb 18, 9:18 am, AdlerSam <Christof.Warl...@siemens.com> wrote:
> > Polymorphism is to use the same textual code to handle objects of different types.
>
>
> Agreed, with the definition you gave, these are examples of (static)
> polymorphism. But what is so special w.r.t. the CRTP in the context of
> polymorphism then?
I'm not even sure how to iterpret "curiously recurring template
pattern".
But it does seem that what this pattern does is to enforce common
interface on groups of classes.
The template Base<> defines the group, and if you want to write a
class that belongs to the group, you have to define it:
class X: Base<X> {...}
I think this is trying to enforce concepts in the code (maybe that's
what they call static polymorphism). See boost/concept_check:
http://www.boost.org/doc/libs/1_45_0...cept_check.htm
itaj