On Thu, Jan 13, 2011 at 12:22:21AM +0200, Elazar Leibovich wrote: > On Thu, Jan 13, 2011 at 12:03 AM, Tzafrir Cohen <tzaf...@cohens.org.il>wrote: > > > > 1) Just use std::map, and ignore the performance penalty, no one will > > > probably notice. > > > > People do notice. This does not work in real life (in too many cases). > > > > I really think that in most cases CPU is not the bottleneck, but of course > it can be false for a specific application. This is not the main point here. > > > > > > > 2) Copy an efficient map implementation from somewhere (as in > > copy-paste), > > > eg strinx.sf.net, and use it. > > > > This leads you to having duplicated useless code in your tree. > > > > Again, from a purity POV this is bad, since you could add this duplicated > code as a library and it would be more sound. However from practical POV, > it'll work, it's reduce dependencies of the project, it makes it more > portable, and it's good enough. > > > > > > > 3) Have a project in a separate directory which implements an efficient > > map > > > in a siusing existing map implementation. For this project, it makes > > sense > > > to use autotools. But this project will provide a solid testable > > interface > > > (ie .hpp file) for this map. > > > > So how can I pass parameters to the configure script? > > > > You don't. That's the whole point. In 99.9% of the cases, you don't want to > pass parameters to the configure script. A portable efficient std::map > implementation is an example where you should design your program so that no > parameters would be needed. the autosuite will figure out which platform are > you in, and will compile the appropriate files for this platform. But your > main logic wouldn't need the autosuite at all, the main logic of your code > would only depend on the portability layer.
But it's a system (or user-installed) library. Why would I need to bundle it with my code? -- Tzafrir Cohen | tzaf...@jabber.org | VIM is http://tzafrir.org.il | | a Mutt's tzaf...@cohens.org.il | | best tzaf...@debian.org | | friend _______________________________________________ Linux-il mailing list Linux-il@cs.huji.ac.il http://mailman.cs.huji.ac.il/mailman/listinfo/linux-il