From: Roy S. <roy...@ic...> - 2010-11-22 22:43:52
|
The boost suggestion reminds me of something I meant to bring up on Friday (before work and vacation packing distracted me): we need to use some shared_ptr classes. Vikram's doing some work with the ErrorMap, and looking at that again reminds me how horrible it is to force manual memory management into non-performance-critical sections of user code. I'd originally planned on writing a SharedPtr wrapper that would hook to C++0x or to optional boost or to an internal fallback... but maybe it's time to bite the bullet and just introduce boost as a libMesh dependency? Other opinions would be appreciated. --- Roy On Mon, 22 Nov 2010, Chetan Jhurani wrote: >> -----Original Message----- >> From: John Peterson [mailto:pet...@cf...] >> >> #2a - I agree that macros are evil, but this one is pretty benign: >> >> #define DISALLOW_COPY_AND_ASSIGN(TypeName) \ >> TypeName(const TypeName&); \ >> void operator=(const TypeName&); > > > Just a curious lurker here. What about a non-macro solution: > > http://www.boost.org/doc/libs/1_43_0/boost/noncopyable.hpp > > Chetan > > >> And you place it into the private section of a class via: >> >> class D >> { >> public: >> D() { } >> D(int) { } >> >> private: >> // Macro explicitly prevents copy and assignment by declaring >> // them private. (Note, you must put the private section in >> // yourself, it's not part of the macro!) >> DISALLOW_COPY_AND_ASSIGN(D); >> }; >> >> -- >> John > > > > ------------------------------------------------------------------------------ > Increase Visibility of Your 3D Game App & Earn a Chance To Win $500! > Tap into the largest installed PC base & get more eyes on your game by > optimizing for Intel(R) Graphics Technology. Get started today with the > Intel(R) Software Partner Program. Five $500 cash prizes are up for grabs. > http://p.sf.net/sfu/intelisp-dev2dev > _______________________________________________ > Libmesh-devel mailing list > Lib...@li... > https://lists.sourceforge.net/lists/listinfo/libmesh-devel > |