
-----Original Message----- From: boost-bounces@lists.boost.org [mailto:boost-bounces@lists.boost.org] On Behalf Of Simonson, Lucanus J Sent: Sunday, October 07, 2007 2:01 PM To: boost@lists.boost.org Subject: Re: [boost] [GTL] - geometric template library - determininginterest
Marco wrote:
For what I can understand you have one class 'b' in B library that you want to use with alghoritms of _both_ A and B library the pattern is:
1 - get the class 'a' subclassing 'b'; class a : b 2 - add to 'a' interfaces to deal with algorithms of library A 3 - implement that interfaces using methods of 'b' and/or functions of library B acting on 'b' 4 - use 'a' with library A using the above interface 5 - use 'a' with library B because base class of 'a' is a 'b' Is this interpretation correct ?
Yes, though I would add that the intention is to use it with classes b1 through bN of libraries B1 through BN so that the effort of making the library generic is worthwhile. Class a inherits from each of the classes b1 through bN through its template parameter. In this way it is as useful as making class a the common base class of b1 through bN, but is not intrusive and leaves the code of libraries B1 through BN untouched. This inheriting one class from many allows us to unify the disparate semantics of many different types that are conceptually similar. I have found it very useful in my day to day work since I end up being the person integrating my library into existing code bases in addition to authoring it.
Lucanus Simonson _______________________________________________ Unsubscribe & other changes: http://lists.boost.org/mailman/listinfo.cgi/boost
So the "concept" is also an "adapter"? Wouldn't it make sense to break things down differently; The concepts should lay down the minimal syntax requirements for your own library. You can then provide any number of adapters to and from any other library in order to satisfy your concepts. Asking your 'concept' to be an adapter seems like it may get confusing. -- John