Boost logo

Boost Users :

From: Richard Damon (Richard_at_[hidden])
Date: 2006-10-06 13:42:53


How about having B declare its constructors private and make T a friend so
it has access?

Richard Damon

-----Original Message-----
From: boost-users-bounces_at_[hidden]
[mailto:boost-users-bounces_at_[hidden]] On Behalf Of Stefan Schild
Sent: Thursday, October 05, 2006 4:51 PM
To: boost-users_at_[hidden]
Subject: [Boost-users] Enforcing CRTP with the MPL?

Hi there

Having a templatized base class B

template<class T>
class B .....

is it possible to enforce that a class D can derive from B IF AND ONLY
IF the curiously recurring template pattern is applied, that is

class D1 : public B<D1> ... // ok, compile
class D2 : public B<X> ... // not ok, do not compile

???

Thx
Stefan

_______________________________________________
Boost-users mailing list
Boost-users_at_[hidden]
http://lists.boost.org/mailman/listinfo.cgi/boost-users


Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net