Andre Poenitz wrote:
On Thu, Aug 16, 2007 at 01:59:21AM -0000, [EMAIL PROTECTED] wrote:
+BibTeXInfo::BibTeXInfo(bool isBibTeX): isBibTeX(isBibTeX)
+{}
It's also one of the rare cases where a default argument might make
sense. Also, really trivial code (i.e. 'fits on the line') can go to the
header, less line noise for us and more chances for the optimizer.
I thought I shouldn't do that, since this class definition is in Biblio_typedefs.h, which is supposed to just give the type definitions. But I can put it there.
+bool BibTeXInfo::hasKey(docstring const & key) +{
+       const_iterator it = find(key);
+       return it == end();
+}
Method could be const?

Lars receently suggested to use
   return count(key);
or more explicitly
   return count(key) == 1
as idiom.
Yes...and that's a very nice idiom indeed.
-
+       //FIXME ?? return it->second??
+       BibTeXInfo & data2 = const_cast<BibTeXInfo &>(data);
+       return data2[key];
+}
FIXME??  it->second seems suitable.
Whoops. This was a late catch of mine, and I forgot to fix it.

I'll commit these with the updated citation dialog, as this code is again in flux.

Richard

--
==================================================================
Richard G Heck, Jr
Professor of Philosophy
Brown University
http://frege.brown.edu/heck/
==================================================================
Get my public key from http://sks.keyserver.penguin.de
Hash: 0x1DE91F1E66FFBDEC
Learn how to sign your email using Thunderbird and GnuPG at:
http://dudu.dyn.2-h.org/nist/gpg-enigmail-howto

Reply via email to