Commit 24b087af authored by GILLES Sebastien's avatar GILLES Sebastien

#1420 Stop overloading operator<< in namespace std.

parent d68e204e
......@@ -44,23 +44,14 @@ namespace MoReFEM
}
} // namespace MoReFEM
namespace std
{
std::ostream& operator<<(std::ostream& stream, const MoReFEM::QuadraturePoint& point)
std::ostream& operator<<(std::ostream& stream, const QuadraturePoint& point)
{
point.Print(stream);
return stream;
}
} // namespace std
} // namespace MoReFEM
/// @} // addtogroup FiniteElementGroup
......@@ -110,21 +110,14 @@ namespace MoReFEM
};
///@} // \addtogroup
} // namespace MoReFEM
namespace std
{
//! \copydoc doxygen_hide_std_stream_out_overload
std::ostream& operator<<(std::ostream& stream, const QuadraturePoint& rhs);
//! \copydoc doxygen_hide_std_stream_out_overload
std::ostream& operator<<(std::ostream& stream, const MoReFEM::QuadraturePoint& rhs);
///@} // \addtogroup
} // namespace std
} // namespace MoReFEM
/// @} // addtogroup FiniteElementGroup
......
......@@ -17,18 +17,18 @@
# include "FiniteElement/Unknown/EnumUnknown.hpp"
namespace std
namespace MoReFEM::UnknownNS
{
std::ostream& operator<<(std::ostream& stream, const ::MoReFEM::UnknownNS::Nature nature)
std::ostream& operator<<(std::ostream& stream, const Nature nature)
{
switch(nature)
{
case ::MoReFEM::UnknownNS::Nature::scalar:
case Nature::scalar:
stream << "scalar";
break;
case ::MoReFEM::UnknownNS::Nature::vectorial:
case Nature::vectorial:
stream << "vectorial";
break;
}
......@@ -37,7 +37,7 @@ namespace std
}
} // namespace std
} // namespace MoReFEM::UnknownNS
/// @} // addtogroup FiniteElementGroup
......
......@@ -34,22 +34,15 @@ namespace MoReFEM
};
} // namespace UnknownNS
} // namespace MoReFEM
//! \copydoc doxygen_hide_std_stream_out_overload
std::ostream& operator<<(std::ostream& stream, const Nature rhs);
namespace std
{
//! \copydoc doxygen_hide_std_stream_out_overload
std::ostream& operator<<(std::ostream& stream, const ::MoReFEM::UnknownNS::Nature rhs);
} // namespace UnknownNS
} // namespace std
} // namespace MoReFEM
/// @} // addtogroup FiniteElementGroup
......
......@@ -159,27 +159,16 @@ namespace MoReFEM
{
return is_lowest_processor_;
}
} // namespace MoReFEM
/// @} // addtogroup GeometryGroup
namespace std
{
std::ostream& operator<<(std::ostream& stream, const MoReFEM::Coords& point)
std::ostream& operator<<(std::ostream& stream, const Coords& point)
{
point.Print(stream);
return stream;
}
} // namespace MoReFEM
}
/// @} // addtogroup GeometryGroup
......@@ -489,24 +489,16 @@ namespace MoReFEM
void WriteVTK_PolygonalDataFormat(const Coords& point, std::ostream& stream);
} // namespace MoReFEM
namespace std
{
//! \copydoc doxygen_hide_std_stream_out_overload
std::ostream& operator<<(std::ostream& stream, const MoReFEM::Coords& rhs);
std::ostream& operator<<(std::ostream& stream, const Coords& rhs);
} // namespace std
} // namespace MoReFEM
/// @} // addtogroup GeometryGroup
/// @} // addtogroup GeometryGroup
# include "Geometry/Coords/Coords.hxx"
......
......@@ -194,24 +194,16 @@ namespace MoReFEM
return true;
}
} // namespace MoReFEM
namespace std
{
std::ostream& operator<<(std::ostream& stream, const MoReFEM::LocalCoords& point)
std::ostream& operator<<(std::ostream& stream, const LocalCoords& point)
{
point.Print(stream);
return stream;
}
} // namespace std
} // namespace MoReFEM
/// @} // addtogroup GeometryGroup
......@@ -214,18 +214,13 @@ namespace MoReFEM
std::pair<unsigned int, double> ExtractIdenticalComponentIndex(const std::vector<LocalCoords>& coords_list);
} // namespace MoReFEM
namespace std
{
//! \copydoc doxygen_hide_std_stream_out_overload
std::ostream& operator<<(std::ostream& stream, const MoReFEM::LocalCoords& rhs);
std::ostream& operator<<(std::ostream& stream, const LocalCoords& rhs);
} // namespace std
} // namespace MoReFEM
/// @} // addtogroup GeometryGroup
......
......@@ -94,27 +94,17 @@ namespace MoReFEM
{
coordinate_list_.fill(0.);
}
} // namespace MoReFEM
/// @} // addtogroup GeometryGroup
namespace std
{
std::ostream& operator<<(std::ostream& stream, const MoReFEM::SpatialPoint& point)
std::ostream& operator<<(std::ostream& stream, const SpatialPoint& point)
{
point.Print(stream);
return stream;
}
} // namespace MoReFEM
}
/// @} // addtogroup GeometryGroup
......@@ -203,21 +203,13 @@ namespace MoReFEM
double Distance(const SpatialPoint& lhs, const SpatialPoint& rhs);
//! \copydoc doxygen_hide_std_stream_out_overload
std::ostream& operator<<(std::ostream& stream, const SpatialPoint& rhs);
} // namespace MoReFEM
namespace std
{
//! \copydoc doxygen_hide_std_stream_out_overload
std::ostream& operator<<(std::ostream& stream, const MoReFEM::SpatialPoint& rhs);
} // namespace MoReFEM
} // namespace std
/// @} // addtogroup GeometryGroup
......
......@@ -71,46 +71,37 @@ namespace MoReFEM
assert(false && "Was called for an interface_name that didn't match an actual interface!");
return Nature::undefined;
}
} // namespace InterfaceNS
} // namespace MoReFEM
namespace std
{
std::ostream& operator<<(std::ostream& stream, MoReFEM::InterfaceNS::Nature nature)
{
switch (nature)
std::ostream& operator<<(std::ostream& stream, Nature nature)
{
case MoReFEM::InterfaceNS::Nature::vertex:
case MoReFEM::InterfaceNS::Nature::edge:
case MoReFEM::InterfaceNS::Nature::face:
case MoReFEM::InterfaceNS::Nature::volume:
switch (nature)
{
const auto& interface_name_map = InterfaceNameMap();
auto it = interface_name_map.find(nature);
assert(it != interface_name_map.cend());
stream << it->second;
break;
case MoReFEM::InterfaceNS::Nature::vertex:
case MoReFEM::InterfaceNS::Nature::edge:
case MoReFEM::InterfaceNS::Nature::face:
case MoReFEM::InterfaceNS::Nature::volume:
{
const auto& interface_name_map = InterfaceNameMap();
auto it = interface_name_map.find(nature);
assert(it != interface_name_map.cend());
stream << it->second;
break;
}
case MoReFEM::InterfaceNS::Nature::none:
case MoReFEM::InterfaceNS::Nature::undefined:
assert(false);
break;
}
case MoReFEM::InterfaceNS::Nature::none:
case MoReFEM::InterfaceNS::Nature::undefined:
assert(false);
break;
return stream;
}
return stream;
}
} // namespace std
} // namespace InterfaceNS
} // namespace MoReFEM
/// @} // addtogroup GeometryGroup
......@@ -73,24 +73,16 @@ namespace MoReFEM
Nature GetNature(const std::string& interface_name);
} // namespace InterfaceNS
} // namespace MoReFEM
namespace std
{
/*!
* \copydoc doxygen_hide_std_stream_out_overload
*/
std::ostream& operator<<(std::ostream& stream, Nature rhs);
/*!
* \copydoc doxygen_hide_std_stream_out_overload
*/
std::ostream& operator<<(std::ostream& stream, MoReFEM::InterfaceNS::Nature rhs);
} // namespace InterfaceNS
} // namespace std
} // namespace MoReFEM
/// @} // addtogroup GeometryGroup
......
......@@ -17,11 +17,11 @@
#include "Geometry/RefGeometricElt/Internal/Topology/EnumTopology.hpp"
namespace std
namespace MoReFEM::RefGeomEltNS::TopologyNS
{
std::ostream& operator<<(std::ostream& stream, const MoReFEM::RefGeomEltNS::TopologyNS::Type topology)
std::ostream& operator<<(std::ostream& stream, const Type topology)
{
using type = MoReFEM::RefGeomEltNS::TopologyNS::Type;
......@@ -52,7 +52,7 @@ namespace std
}
} // namespace std
} // namespace MoReFEM::RefGeomEltNS::TopologyNS
/// @} // addtogroup GeometryGroup
......@@ -42,6 +42,15 @@ namespace MoReFEM
};
/*!
* \copydoc doxygen_hide_std_stream_out_overload
*
* The name of the underlying topology is written in lower case, for instance "triangle".
*
*/
std::ostream& operator<<(std::ostream& stream, const Type rhs);
} // namespace TopologyNS
......@@ -52,24 +61,7 @@ namespace MoReFEM
} // namespace MoReFEM
namespace std
{
/*!
* \copydoc doxygen_hide_std_stream_out_overload
*
* The name of the underlying topology is written in lower case, for instance "triangle".
*
*/
std::ostream& operator<<(std::ostream& stream, const MoReFEM::RefGeomEltNS::TopologyNS::Type rhs);
} // namespace std
/// @} // addtogroup GeometryGroup
#endif // MOREFEM_x_GEOMETRY_x_REF_GEOMETRIC_ELT_x_INTERNAL_x_TOPOLOGY_x_ENUM_TOPOLOGY_HPP_
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment