几何尺寸与公差论坛------致力于产品几何量公差标准GD&T (GDT:ASME)|New GPS(ISO)研究/CAD设计/CAM加工/CMM测量

几何尺寸与公差论坛------致力于产品几何量公差标准GD&T (GDT:ASME)|New GPS(ISO)研究/CAD设计/CAM加工/CMM测量 (http://www.dimcax.com/hust/index.php)
-   DirectDWG (http://www.dimcax.com/hust/forumdisplay.php?f=89)
-   -   【转帖】odstringformat90 issue (http://www.dimcax.com/hust/showthread.php?t=17769)

yang686526 2009-05-06 09:11 PM

【转帖】odstringformat90 issue
 
odstring::format() issue
odstring::format() issue
hi,
can you make a version of odstring with member format, that returns a reference to the string:
odstring& odstring::format(...);
thus when a function needs a string parameter and time is not critical, one can simply say:
func_that_need_string( odstring().format(...) );
instead of:
odstring str;
str.format(...);
func_that_need_string( str );
the simpler, the better....
thanks
regards
chudomir
best regards
chudomir

i think it's good idea. and other functions like trimleft etc. too.
btw, i think that performance will not suffer if odstring& is returned instead of void (one more mov command)
sergey slezkin

this would be great if you do it!
also no existing code of your users will be changed since of ignoring the returned value.
thanks
regards
chudomir
best regards
chudomir


所有的时间均为北京时间。 现在的时间是 11:05 AM.