Boost.Operators base class chaining

AMDG I am trying to create a library for type erasure(for boost if there is enough interest). I would like to define some common operations like arithmetic, I/O &c. For some of these I want to use Boost.Operators to provide the other related operations. I am also, however, using parametized inheritance in order to allow several operations to be combined. This for example is the definition of incrementable: namespace erasures { struct incrementable : operation<incrementable> { template<class T> struct static_impl : implementation<void (T&)> { static void execute(T& t) { ++t; } }; template<class Base> struct partial_interface : *boost::incrementable<typename Base::erasure_full_t, Base>* { typename Base::erasure_full_t& operator++() { erasures::call<erasures::incrementable>(*this); return(*erasures::full(this)); } }; }; } Is use of base class chaining in this way part of the public API of Boost.Operators? - Base may not be related to Boost.Operators in any way. Or should I use multiple inheritance instead? In Christ, Steven Watanabe

Steven Watanabe wrote:
Is use of base class chaining in this way part of the public API of Boost.Operators? - Base may not be related to Boost.Operators in any way. Or should I use multiple inheritance instead?
Base class chaining has been a documented and stable part of the operators library's interface for a long time now and it is still relevant for today's compilers. It has not been deprecated and I don't see any reason to do so. As far as I'm concerned, it's an official part of the interface - no guarantees for the future, though. That said, it's up to you how you make use of it. Just because it was designed as an internal helper shouldn't prevent you from using it for your own purposes. Regards, Daniel

Steven Watanabe <steven@providere-consulting.com> writes:
I am trying to create a library for type erasure(for boost if there is enough interest).
Are you familiar with Alexander Nasonov's dynamic_any? http://www.google.com/search?sourceid=mozclient&ie=utf-8&oe=utf-8&q=nasonov+dynamic_any -- Dave Abrahams Boost Consulting www.boost-consulting.com
participants (3)
-
Daniel Frey
-
David Abrahams
-
Steven Watanabe