Commit 43730cb7 authored by Anton Gladky's avatar Anton Gladky

Fix GCC-10: error: multi-line comment

parent 74092955
......@@ -78,27 +78,29 @@ namespace math {
}
namespace Eigen {
// These operator<< specialisations have to be in Eigen namespace because ::boost::log
// namespace can perform ADL lookup only into ::std and ::Eigen namespaces when
// searching for an overlaod of std::ostream& operator<<(std::ostream& os,const ::yade::Vector3<Scalar>& v)
// and others. This is because our ::yade::Vector* typedefs in fact resolve into types from ::Eigen.
//
// So without putting these operator<< inside ::Eigen namespace the default Eigen operator<<(…)
// are used by ::boost::log
//
// This is clearly a bug. However I am not sure what is to blame:
// (1) The ADL not flexible enough, and ignoring ::yade entirely?
// (2) The ::boost::log, because the ADL allows it to check only ::std and ::Eigen and has no opportunity
// to check ::yade?
// (3) The Logger.hpp, because writing some variation of 'namespace boost{namespace log{ using ::yade::operator<<; }}'
// in Logger.hpp probably could also make it work? But Logger.hpp has no idea about Eigen at all. Putting it
// there is causing an #include-dependency cycle.
//
// This interesting problem was brought to you by four namespaces:
//
// ( g l o b a l n a m e s a p a c e )
// / | | \
// ::boost::log ::Eigen ::std ::yade
/*
These operator<< specialisations have to be in Eigen namespace because ::boost::log
namespace can perform ADL lookup only into ::std and ::Eigen namespaces when
searching for an overlaod of std::ostream& operator<<(std::ostream& os,const ::yade::Vector3<Scalar>& v)
and others. This is because our ::yade::Vector* typedefs in fact resolve into types from ::Eigen.
So without putting these operator<< inside ::Eigen namespace the default Eigen operator<<(…)
are used by ::boost::log
This is clearly a bug. However I am not sure what is to blame:
(1) The ADL not flexible enough, and ignoring ::yade entirely?
(2) The ::boost::log, because the ADL allows it to check only ::std and ::Eigen and has no opportunity
to check ::yade?
(3) The Logger.hpp, because writing some variation of 'namespace boost{namespace log{ using ::yade::operator<<; }}'
in Logger.hpp probably could also make it work? But Logger.hpp has no idea about Eigen at all. Putting it
there is causing an #include-dependency cycle.
This interesting problem was brought to you by four namespaces:
( g l o b a l n a m e s a p a c e )
| | | |
::boost::log ::Eigen ::std ::yade
*/
template <class Scalar>::std::ostream& operator<<(::std::ostream& os, const ::yade::Vector2<Scalar>& v)
{
......
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