Problematic using-declarations in Xdmf3 header(s)...
Xmdf3 header file core/XdmfSharedPtr.hpp
contains the following using declaration:
using boost::shared_ptr;
This promotes shared_ptr
to global namespace when this header is included directly or indirectly. This may cause conflicts with std::shared_ptr
. Placing using-declarations in library header files should be discouraged especially in global namespace. A slightly better alternative would be to put this in a library-specific namespace. For example:
namespace Xdmf
{
using boost::shared_ptr;
}
The safest option is to put this using-declaration in the innermost block that needs it in .cpp
files. Alternatively, it may be placed at the top of the .cpp
file that need it (or in a header that is for internal use only and is never installed as part of the library).