I just ran across a third exception to the "all code works unchanged" rule; I figured I might as well post it to the list where search engines can find it to help people upgrading in the future.
With that "using namespace libMesh;" active, some identifiers that were previously wrapped safely in the libMesh namespace can be brought into conflict with the same identifiers in the global namespace. I just needed to change an old application's "bool initialized;" to "bool ICs_initialized;" to work around a conflict with the library's libMesh::initialized() function. --- Roy On Mon, 28 Jun 2010, Roy Stogner wrote: > There's a "using namespace libMesh;" in the library itself, which is > enough that nearly all code works unchanged. > > There are at least a couple exceptions, which require ugly workarounds > if you want to be compatible with both pre-patch and post-patch > library versions: > > // forward declarations of libMesh classes: > #include "libmesh_base.h" > #ifdef LIBMESH_USE_SEPARATE_NAMESPACE > namespace libMesh { > class Point; > class Elem; > } > #else > class Point; > class Elem; > #endif > > // template specializations of libMesh classes: > #ifdef LIBMESH_USE_SEPARATE_NAMESPACE > libMesh::FactoryImp<HeatTransfer, Physics> heat_transfer_factory ("Heat > Transfer"); > #else > FactoryImp<HeatTransfer, Physics> heat_transfer_factory ("Heat Transfer"); > #endif ------------------------------------------------------------------------------ Sell apps to millions through the Intel(R) Atom(Tm) Developer Program Be part of this innovative community and reach millions of netbook users worldwide. Take advantage of special opportunities to increase revenue and speed time-to-market. Join now, and jumpstart your future. http://p.sf.net/sfu/intel-atom-d2d _______________________________________________ Libmesh-devel mailing list Libmesh-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/libmesh-devel