From: Dean M. B. <mik...@gm...> - 2010-10-25 05:36:18
|
Hi Mark, On Mon, Oct 25, 2010 at 7:41 AM, Mark Wright <mar...@in...> wrote: > Hi, > > flex_string included in Loki, and hidden away in the implementation > of one of the Boost libraries, is a policy based design string class > described in Modern C++ Design by Alexandrescu: > > http://www.drdobbs.com/184403784 > Cool, thanks for the link. I myself have some issue with policy-based design as it puts too much of a burden on the user and implementer in case: 1) The user wants to choose a different policy or mix of policies from the default. 2) The implementer wants to add new policies and/or change the internal details of the implementation. The reason why cpp-netlib has just a tag dispatch mechanism and has all traits/metafunctions deal with the tags is to put the burden on the implementers/extenders instead of the users. This is a different tradeoff, and even if we do use policy-based design internally, the users don't ever have to see these policies -- they just choose which tag or combination of tags they want. > Its neat as the user can choose whether they want thread locking > or not, as well as the copy semantics. > Yeah, but that's overkill really for what I want to do -- I just want a string that's immutable. :) > Thanks, Mark Thank you too Mark. :) -- Dean Michael Berris deanberris.com |