Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.lang.c++ > #13799
| From | 88888 Dihedral <dihedral88888@googlemail.com> |
|---|---|
| Newsgroups | comp.lang.c++ |
| Subject | Re: member function swap vs std::move |
| Date | 2012-02-05 19:33 -0800 |
| Organization | http://groups.google.com |
| Message-ID | <357541.2165.1328499208594.JavaMail.geo-discussion-forums@prmu37> (permalink) |
| References | <cb752c72-5b76-40e5-945f-cfd726b1652d@l16g2000vbl.googlegroups.com> <33109983.2179.1328492401830.JavaMail.geo-discussion-forums@prj1> <f5446b78-1f57-4c7c-bced-7db83a9ad475@t15g2000yqi.googlegroups.com> |
在 2012年2月6日星期一UTC+8上午10时17分02秒,Fabrizio J Bonsignore写道: > What about the memory-runtime tradeoff? Can you be more specific as to > where you spend more runtime to save more memory and viceversa? Swap > should always be more memory intensive; move can be done purely > runtime with a single intermediate hold variable, independently of how > many castings/polymorphisms/new-copy constructors you might have to > call. (Particularly with swap you would be invoking copy constructors > a gallore, so they may be factorized out of the comparison function, > but it would depend on your pointer-auto object regime). What > framework did you say you are using this in? > > Danilo J Bonsignore Condsider a class inherited in 6 levels from the root and at each level of 2 to 6 mutilevel inheritances of classes, then the growth of an expoential rate of memory used by an object for its properties and methods from all super classes in the class level is unavoiadable. Thus, for an object in a class that has to support all its upper classes functionality eat the heap like a hog very often. This helps the DRAM industry a lot, but it does not help in training professional programmers to produce better SW. Unless the programmers will gain profits from the DRAM sellers, I can't agree with those teasing tricks as a SW programmer.
Back to comp.lang.c++ | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread
member function swap vs std::move m0shbear <andrey.vul@gmail.com> - 2012-02-05 14:41 -0800
Re: member function swap vs std::move 88888 Dihedral <dihedral88888@googlemail.com> - 2012-02-05 17:40 -0800
Re: member function swap vs std::move Fabrizio J Bonsignore <syntotic@gmail.com> - 2012-02-05 18:17 -0800
Re: member function swap vs std::move Fabrizio J Bonsignore <syntotic@gmail.com> - 2012-02-05 18:30 -0800
Re: member function swap vs std::move 88888 Dihedral <dihedral88888@googlemail.com> - 2012-02-05 19:33 -0800
Re: member function swap vs std::move 88888 Dihedral <dihedral88888@googlemail.com> - 2012-02-07 06:02 -0800
csiph-web