From: Sean P. <sp...@ad...> - 2005-12-14 10:00:59
|
It isn't _that_ suboptimal. The time to construct a name_t is O(log (N)) where N is the number of names in the current process. The comparisons are also optimized to be reasonably fast so this should perform just fine for most usage. Sean On Dec 13, 2005, at 8:47 PM, Thomas Witt wrote: > > Hi, > > The first code snippet in the dictionary example contains the > following function: > > void foo(adobe::dictionary_t param) // makes a copy of the > dictionary_t > { > std::cout << param[adobe::name_t("my_key")].get<std::string>(); > } > > If I understand the characteristics of name_t correctly the usage > of a tempory name_t here is, well suboptimal. The construction is O > (n) where n is the number of distinct name_t values in the process. > I am aware that name_t usage is not the point here, but this > particular usage looks so natural that it might be worthwile to > avoid misleading the programmer even in unrelated examples. > > Just my 2ct > > Thomas > > -- > Thomas Witt > wi...@ac... > > > ------------------------------------------------------- > This SF.net email is sponsored by: Splunk Inc. Do you grep through > log files > for problems? Stop! Download the new AJAX search engine that makes > searching your log files as easy as surfing the web. DOWNLOAD > SPLUNK! > http://ads.osdn.com/?ad_id=7637&alloc_id=16865&op=click > _______________________________________________ > Adobe-source-devel mailing list > Ado...@li... > https://lists.sourceforge.net/lists/listinfo/adobe-source-devel |