Skip to content
Snippets Groups Projects
Commit 4a4f9781 authored by Christian Engwer's avatar Christian Engwer
Browse files

fix io problems with certain compilers (I think this was gcc-3.4)

by moving the definition of operator << outside the class declaration.

[[Imported from SVN: r5925]]
parent 61185cad
No related branches found
No related tags found
No related merge requests found
......@@ -162,44 +162,55 @@ namespace Dune {
return basicType_ < other.basicType_;
}
/** \brief Prints the type to an output stream */
friend std::ostream& operator<< (std::ostream& s, const GeometryType& a)
{
switch (a.basicType_) {
case simplex :
s << "(simplex, " << a.dim_ << ")";
break;
case cube :
s << "(cube, " << a.dim_ << ")";
break;
case pyramid :
s << "pyramid";
break;
case prism :
s << "prism";
break;
case none :
s << "(none, " << a.dim_ << ")";
break;
default :
s << "invalid geometry type";
}
return s;
}
friend inline std::ostream& operator<< (std::ostream& s, const GeometryType& a);
};
/** \brief Prints the type to an output stream */
inline std::ostream& operator<< (std::ostream& s, const GeometryType& a)
{
switch (a.basicType_) {
case GeometryType::simplex :
s << "(simplex, " << a.dim_ << ")";
break;
case GeometryType::cube :
s << "(cube, " << a.dim_ << ")";
break;
case GeometryType::pyramid :
s << "pyramid";
break;
case GeometryType::prism :
s << "prism";
break;
case GeometryType::none :
s << "(none, " << a.dim_ << ")";
break;
default :
s << "invalid geometry type";
}
return s;
}
/** \brief Prints a GeometryType::BasicType to an output stream */
inline std::ostream& operator<< (std::ostream& s, GeometryType::BasicType type)
{
switch (type) {
case GeometryType::simplex : s << "simplex"; break;
case GeometryType::cube : s << "cube"; break;
case GeometryType::pyramid : s << "pyramid"; break;
case GeometryType::prism : s << "prism"; break;
case GeometryType::none : s << "none"; break;
default : s << "[unknown GeometryType::BasicType: " << int(type) << "]";
case GeometryType::simplex :
s << "simplex";
break;
case GeometryType::cube :
s << "cube";
break;
case GeometryType::pyramid :
s << "pyramid";
break;
case GeometryType::prism :
s << "prism";
break;
case GeometryType::none :
s << "none";
break;
default :
s << "[unknown GeometryType::BasicType: " << int(type) << "]";
}
return s;
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment