[boost] Re: Bidirectional map preliminary submission
Joaquín Mª López Muñoz wrote: > 1. Syntax and semantics > Since bimap follows as closely as possible the interface of std::map, > there's little IMHO to add or remove from here. The added constraint > of bidirectionality imposes some behavior that diverges from regular > maps, though. I don't think there's an alternate way to handle the > following > issues: > * operator[], when used for inspection on a non-existent value, throws > bimap_base::value_not_found. std::maps, on the other hand, automatically > > insert a default value. This I cannot do in bimap, since it would > violate > the bidirectionality. What about when operator[] is used for an assignment to a unique value? I have to imagine that there are scenarios where inserting a temporary value wouldn't be all that bad. Is it possible to make this a policy of some kind? Or possibly an template parameter to a "default value" generator function? The template parameter could default to a function that throws the exception... > * bimap_base::duplicate_value is thrown whenever an assignment is > attempted to a value already present in the bimap: this again stems from > > the preservation of the bidirectionality invariant. ___ Unsubscribe & other changes: http://lists.boost.org/mailman/listinfo.cgi/boost
Re: [boost] RE: bidirectional map
At 12:27 PM 3/17/2003, Joaquín Mª López Muñoz wrote: > > >Jeff Garland ha escrito: > >> > OK, so how I ask for preliminary review? Posting a mail here? >> >> Yes, you can just ask for preliminary feedback on this list. >> Another thing you can do is put the code in the boost-sandbox. >> This helps get things into the boost structure and allows other >> boosters to keep up with changes as the library is evolving >> towards formal submission. Ask one of the moderators of the >> boost sandbox for CVS access if you want to do this. >> > >OK, I don't know if uploading non-boostified code to the sandbox >is a proper way to do. If so, please some moderator help me do it >(if not, the code is in the Files section aka the vault). I'd say wait until you have Boostified code before putting it in the sandbox. >So, I guess I'll have to wait for comments about the library to pour >in :) Maybe when the dust of 1.30.0 has settled down. Yes:-) --Beman ___ Unsubscribe & other changes: http://lists.boost.org/mailman/listinfo.cgi/boost
Re: [boost] RE: bidirectional map
Jeff Garland ha escrito: > > OK, so how I ask for preliminary review? Posting a mail here? > > Yes, you can just ask for preliminary feedback on this list. > Another thing you can do is put the code in the boost-sandbox. > This helps get things into the boost structure and allows other > boosters to keep up with changes as the library is evolving > towards formal submission. Ask one of the moderators of the > boost sandbox for CVS access if you want to do this. > OK, I don't know if uploading non-boostified code to the sandbox is a proper way to do. If so, please some moderator help me do it (if not, the code is in the Files section aka the vault). So, I guess I'll have to wait for comments about the library to pour in :) Maybe when the dust of 1.30.0 has settled down. Joaquín M López Muñoz Telefónica, Investigación y Desarrollo ___ Unsubscribe & other changes: http://lists.boost.org/mailman/listinfo.cgi/boost
RE: [boost] RE: bidirectional map
> OK, so how I ask for preliminary review? Posting a mail here? Yes, you can just ask for preliminary feedback on this list. Another thing you can do is put the code in the boost-sandbox. This helps get things into the boost structure and allows other boosters to keep up with changes as the library is evolving towards formal submission. Ask one of the moderators of the boost sandbox for CVS access if you want to do this. > I don't really know how to start this process, whether some formality > is required or not. Nope. > To the best of my knowledge, it is very difficult to fit an n-key container, where > > n>2, into the interface of a map. IMHO such a container resembles more a set > (I'm slowly working on this BTW). So, I guess I'll try to Boost this alone. Sounds good. Jeff ___ Unsubscribe & other changes: http://lists.boost.org/mailman/listinfo.cgi/boost
Re: [boost] RE: bidirectional map
jeff ha escrito: > On Wed, 12 Mar 2003 17:07:54 -0600, David B. Held wrote > > > I'd say 6 or 7 people expressing interest is more than enough to justify > > Boostifying the code at this stage. > > I agree. Since you have written an article which clearly describes > the concept and provides an example it seems to me that you should > be able to as for preliminary review from interested parties before > you boostify the documentation. OK, so how I ask for preliminary review? Posting a mail here? I don't really know how to start this process, whether some formality is required or not. [stuff deleted] > > Also, it looks like the early consensus is that multi-key/value > > support is desired, so I think we should have a good look at your > > implementation/design to see if it is general enough. > > While a few folks have asked for this, it is up to you if you really want to > take on the additional burden. Submitting, going thru the review, porting and > maintaining a boost library is a huge amount of effort. While I think a > generic multi-key container would be really cool, it is up to you to accept > that scope. I, for one, would rather see a good bi-directional map sooner > rather than waiting for a more general solution. I honestly can't think of a > case where I would have needed the more general solution and I there is always > a complexity tradeoff. To the best of my knowledge, it is very difficult to fit an n-key container, where n>2, into the interface of a map. IMHO such a container resembles more a set (I'm slowly working on this BTW). So, I guess I'll try to Boost this alone. Joaquín M López Muñoz Telefónica, Investigación y Desarrollo > > > Jeff > ___ > Unsubscribe & other changes: http://lists.boost.org/mailman/listinfo.cgi/boost ___ Unsubscribe & other changes: http://lists.boost.org/mailman/listinfo.cgi/boost
Re: [boost] RE: bidirectional map
jeff ha escrito: > On Wed, 12 Mar 2003 17:07:54 -0600, David B. Held wrote > > > I'd say 6 or 7 people expressing interest is more than enough to justify > > Boostifying the code at this stage. > > I agree. Since you have written an article which clearly describes > the concept and provides an example it seems to me that you should > be able to as for preliminary review from interested parties before > you boostify the documentation. > > OK, so how I ask for preliminary review? Posting a mail here? I don't really know how to start this process, whether some formality is required or not. [stuff deleted] > > > Also, it looks like the early consensus is that multi-key/value > > support is desired, so I think we should have a good look at your > > implementation/design to see if it is general enough. > > While a few folks have asked for this, it is up to you if you really want to > take on the additional burden. Submitting, going thru the review, porting and > maintaining a boost library is a huge amount of effort. While I think a > generic multi-key container would be really cool, it is up to you to accept > that scope. I, for one, would rather see a good bi-directional map sooner > rather than waiting for a more general solution. I honestly can't think of a > case where I would have needed the more general solution and I there is always > a complexity tradeoff. To the best of my knowledge, it is very difficult to fit an n-key container, where n>2, into the interface of a map. IMHO such a container resembles more a set (I'm slowly working on this BTW). So, I guess I'll try to Boost this alone. Joaquín M López Muñoz Telefónica, Investigación y Desarrollo > > Jeff > ___ > Unsubscribe & other changes: http://lists.boost.org/mailman/listinfo.cgi/boost ___ Unsubscribe & other changes: http://lists.boost.org/mailman/listinfo.cgi/boost
Re: [boost] RE: bidirectional map
On Wed, 12 Mar 2003 17:07:54 -0600, David B. Held wrote > I'd say 6 or 7 people expressing interest is more than enough to justify > Boostifying the code at this stage. I agree. Since you have written an article which clearly describes the concept and provides an example it seems to me that you should be able to as for preliminary review from interested parties before you boostify the documentation. > However, I would like to see > what your latest version looks like, and see if we can't perhaps > redesign some of the features that run afoul of non-standard C++. This would be a top priority because I would be surprised if a boost library is accepted requiring non-standard features. > Also, it looks like the early consensus is that multi-key/value > support is desired, so I think we should have a good look at your > implementation/design to see if it is general enough. While a few folks have asked for this, it is up to you if you really want to take on the additional burden. Submitting, going thru the review, porting and maintaining a boost library is a huge amount of effort. While I think a generic multi-key container would be really cool, it is up to you to accept that scope. I, for one, would rather see a good bi-directional map sooner rather than waiting for a more general solution. I honestly can't think of a case where I would have needed the more general solution and I there is always a complexity tradeoff. Jeff ___ Unsubscribe & other changes: http://lists.boost.org/mailman/listinfo.cgi/boost
[boost] RE: bidirectional map
"Joaquín Mª López Muñoz" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > Yes, what I cannot figure out is whether the "Preliminary submission" > step can be reached with a non boostified libary (like mine is now) or > whether it is assumed the library should be Boost-friendly by this stage. I'd say 6 or 7 people expressing interest is more than enough to justify Boostifying the code at this stage. However, I would like to see what your latest version looks like, and see if we can't perhaps redesign some of the features that run afoul of non-standard C++. Also, it looks like the early consensus is that multi-key/value support is desired, so I think we should have a good look at your implementation/design to see if it is general enough. Dave ___ Unsubscribe & other changes: http://lists.boost.org/mailman/listinfo.cgi/boost
Re: [boost] RE: bidirectional map
Jeff Garland ha escrito: [stuff deleted] > > no visit this site so often, so please someone correct me is > > this is not the way to go -- I guess some sort of pre-acceptance is > > required, since the Files section is crowded with stuff and presumably > > not all of it will make it into Boost. > > I presume you have read this page? > > http://www.boost.org/more/submission_process.htm > > Jeff > ___ > Unsubscribe & other changes: http://lists.boost.org/mailman/listinfo.cgi/boost Yes, what I cannot figure out is whether the "Preliminary submission" step can be reached with a non boostified libary (like mine is now) or whether it is assumed the library should be Boost-friendly by this stage. Joaquín M López Muñoz Telefónica, Investigación y Desarrollo ___ Unsubscribe & other changes: http://lists.boost.org/mailman/listinfo.cgi/boost
Re: [boost] RE: bidirectional map
The multiply indexed set seems a most interesting container, and as a matter of fact I'm working on something like that, but progress is slow. There's an issue I guess I should comment here before advancing with this. The code is non-conformant in (at least) two points, neither of which I've found a conformant replacement for: * It is assumed that for these two classes (in simplified form here): template struct direct_pair { A first; B second; }; template struct inv_pair { D second; C first; }; it is asummed, I was saying, than a direct_pair can be reinterpret_cast'ed to a inv_pair (and vice versa) whenever A=D and B=C. I cannot imagine how on earth this couldn't be so for any conceivable compiler, but I'm afraid a strict interpretation of the standard does not guarantee this. * offsetof() is used for non-POD types. The types on which it is used are arguably simple enough to be treated as POD (no virtual methods or anything), but then again the standard bans it. G++ complains at this, an ugly workaround has been applied for this case. I'd like to know whether these two points could prevent bimap from entering Boost, or, in the contrary, they can be tolerated. Standard workarounds are most welcome, of course. Joaquín M López Muñoz Telefónica, Investigación y Desarrollo Daniel Frey ha escrito: > David Abrahams wrote: > > > > It's similar for me. It's one of those things that you don't need > > every day, but when you need it, you really need it. That may be why > > there's not more vociferous interest. Anyhow, while bidirectional > > maps are the most common case, they're not the most general: > > N-directional maps, which I've sometimes needed. > > I'd also be interested in a 'set' of 'tuples' with a user-defined set of > 'views', where a view has its own sort-criterion and its own iterators, > find-functions, etc. At least this is what I imagine but I haven't > worked on it, so I don't know whether it's a realistic approach. > > Regards, Daniel > > PS: And yes, *if* you need them, you really *need* them. > > -- > Daniel Frey > > aixigo AG - financial training, research and technology > Schloß-Rahe-Straße 15, 52072 Aachen, Germany > fon: +49 (0)241 936737-42, fax: +49 (0)241 936737-99 > eMail: [EMAIL PROTECTED], web: http://www.aixigo.de > ___ > Unsubscribe & other changes: http://lists.boost.org/mailman/listinfo.cgi/boost ___ Unsubscribe & other changes: http://lists.boost.org/mailman/listinfo.cgi/boost
[boost] Re: bidirectional map
Daniel Frey wrote: > > I'd also be interested in a 'set' of 'tuples' with a user-defined set of > 'views', where a view has its own sort-criterion and its own iterators, > find-functions, etc. At least this is what I imagine but I haven't > worked on it, so I don't know whether it's a realistic approach. > > Regards, Daniel > > PS: And yes, *if* you need them, you really *need* them. Why was I thinking "bi-directional graph"? Anyway, I would also love to see something like that (now that I realize what you were talking about). Maybe more along the lines of the more generalized cases that people are saying. I believe that in the past, I've wanted to have 2 different keys for the same data... A bi-directional map seems like it would be a good specialization to have since like a map, a bi-directional map seems like it would be a more common case. I wouldn't want to stop at just a bi-directional map though. ___ Unsubscribe & other changes: http://lists.boost.org/mailman/listinfo.cgi/boost
Re: [boost] RE: bidirectional map
David Abrahams wrote: > > It's similar for me. It's one of those things that you don't need > every day, but when you need it, you really need it. That may be why > there's not more vociferous interest. Anyhow, while bidirectional > maps are the most common case, they're not the most general: > N-directional maps, which I've sometimes needed. I'd also be interested in a 'set' of 'tuples' with a user-defined set of 'views', where a view has its own sort-criterion and its own iterators, find-functions, etc. At least this is what I imagine but I haven't worked on it, so I don't know whether it's a realistic approach. Regards, Daniel PS: And yes, *if* you need them, you really *need* them. -- Daniel Frey aixigo AG - financial training, research and technology Schloß-Rahe-Straße 15, 52072 Aachen, Germany fon: +49 (0)241 936737-42, fax: +49 (0)241 936737-99 eMail: [EMAIL PROTECTED], web: http://www.aixigo.de ___ Unsubscribe & other changes: http://lists.boost.org/mailman/listinfo.cgi/boost
[boost] Re: bidirectional map
I'm interested in a bi-direcional map as well. While I don't have a current need for one, there have been several times in the past that I wished I had one and made do with something else. Mike Joaquín Mª López Muñoz wrote: > Eric Martel wrote: > >>> Hi, >>> >>> After a quick Google search, I found out that Joaquín M López, the > author of >>> a bidirectionnal map hosted on codeproject sent a message (Mon, 21 >>> Oct > 2002 >>> 21:29:18) on the boost mailing list to promote his library. David >>> B. > Held >>> replied about using his work to include the bidirectionnal map to > boost, to >>> avoid library proliferation. >>> >>> So now, here's my question : >>> >>> Nearly 5 months later, did anyone work on this bimap? Will it be > included >>> anytime soon in an official distribution of boost? >>> >>> Thanks a lot for your time >>> >>> Cheers, >>> >>> Eric > > Well, it was my intention then to probe the Boost community for > interest > in the > library, and my impression was it raised little impetus. In the > meantime > I've > polished the code so that now it runs in a handful of compilers. > > I guess I can try again. For easy access the code is now in the Files > section, in > the folder bimap, as well as a pointer to the docs in CodeProject. The > library is > not boostified, but I feel I should only carry out that work if people > here > likes the library. I do no visit this site so often, so please someone > correct me is > this is not the way to go -- I guess some sort of pre-acceptance is > required, since > the Files section is crowded with stuff and presumably not all of it > will make it into > Boost. > > Looking forward to your comments, regards, > > Joaquín M López Muñoz > Telefónica, Investigación y Desarrollo > > ___ > Unsubscribe & other changes: > http://lists.boost.org/mailman/listinfo.cgi/boost ___ Unsubscribe & other changes: http://lists.boost.org/mailman/listinfo.cgi/boost
Re: [boost] RE: bidirectional map
"Jeff Garland" <[EMAIL PROTECTED]> writes: >> Well, it was my intention then to probe the Boost community for interest >> in the library, and my impression was it raised little impetus. > > Ok, well I would be interested in seeing this in boost. A > project I am working on would have benefited from a birectional > map and it seems like a pretty handy bit of infrastructure for > solving some basic problems like mapping strings to ints and back. > Perhaps others will speak up now... It's similar for me. It's one of those things that you don't need every day, but when you need it, you really need it. That may be why there's not more vociferous interest. Anyhow, while bidirectional maps are the most common case, they're not the most general: N-directional maps, which I've sometimes needed. -- Dave Abrahams Boost Consulting www.boost-consulting.com ___ Unsubscribe & other changes: http://lists.boost.org/mailman/listinfo.cgi/boost
RE: [boost] RE: bidirectional map
> Well, it was my intention then to probe the Boost community for interest > in the library, and my impression was it raised little impetus. Ok, well I would be interested in seeing this in boost. A project I am working on would have benefited from a birectional map and it seems like a pretty handy bit of infrastructure for solving some basic problems like mapping strings to ints and back. Perhaps others will speak up now... > I guess I can try again. For easy access the code is now in the Files > section, in the folder bimap, as well as a pointer to the docs in > CodeProject. The library is not boostified, but I feel I should > only carry out that work if people here likes the library. I do This is wise as it is a non-trivial bit of work... > no visit this site so often, so please someone correct me is > this is not the way to go -- I guess some sort of pre-acceptance is > required, since the Files section is crowded with stuff and presumably > not all of it will make it into Boost. I presume you have read this page? http://www.boost.org/more/submission_process.htm Jeff ___ Unsubscribe & other changes: http://lists.boost.org/mailman/listinfo.cgi/boost
[boost] RE: bidirectional map
Eric Martel wrote: >>Hi, >> >>After a quick Google search, I found out that Joaquín M López, the author of >>a bidirectionnal map hosted on codeproject sent a message (Mon, 21 Oct 2002 >>21:29:18) on the boost mailing list to promote his library. David B. Held >>replied about using his work to include the bidirectionnal map to boost, to >>avoid library proliferation. >> >>So now, here's my question : >> >>Nearly 5 months later, did anyone work on this bimap? Will it be included >>anytime soon in an official distribution of boost? >> >>Thanks a lot for your time >> >>Cheers, >> >>Eric Well, it was my intention then to probe the Boost community for interest in the library, and my impression was it raised little impetus. In the meantime I've polished the code so that now it runs in a handful of compilers. I guess I can try again. For easy access the code is now in the Files section, in the folder bimap, as well as a pointer to the docs in CodeProject. The library is not boostified, but I feel I should only carry out that work if people here likes the library. I do no visit this site so often, so please someone correct me is this is not the way to go -- I guess some sort of pre-acceptance is required, since the Files section is crowded with stuff and presumably not all of it will make it into Boost. Looking forward to your comments, regards, Joaquín M López Muñoz Telefónica, Investigación y Desarrollo ___ Unsubscribe & other changes: http://lists.boost.org/mailman/listinfo.cgi/boost