mirror of https://github.com/CGAL/cgal
Better testing of CGAL::is_streamable<T>
This commit is contained in:
parent
dcfe23867b
commit
9d041ed59a
|
|
@ -5,6 +5,8 @@
|
|||
|
||||
struct A {};
|
||||
struct B {};
|
||||
struct C {};
|
||||
struct D {};
|
||||
|
||||
using std::ostream;
|
||||
using std::istream;
|
||||
|
|
@ -12,6 +14,9 @@ using std::istream;
|
|||
ostream& operator<<(ostream& os, const B&) { return os; }
|
||||
istream& operator>>(istream& is, const B&) { return is; }
|
||||
|
||||
ostream& operator<<(ostream& os, const C&) { return os; }
|
||||
istream& operator>>(istream& is, const D&) { return is; }
|
||||
|
||||
int main() {
|
||||
typedef std::vector<int>::const_iterator vector_it;
|
||||
typedef int* int_p;
|
||||
|
|
@ -19,6 +24,8 @@ int main() {
|
|||
|
||||
CGAL_static_assertion(!is_streamable<A>::value);
|
||||
CGAL_static_assertion(is_streamable<B>::value);
|
||||
CGAL_static_assertion(!is_streamable<C>::value);
|
||||
CGAL_static_assertion(!is_streamable<D>::value);
|
||||
CGAL_static_assertion(is_streamable<int>::value);
|
||||
CGAL_static_assertion(is_streamable<double>::value);
|
||||
CGAL_static_assertion(! (is_streamable<std::pair<int, int> >::value) );
|
||||
|
|
|
|||
Loading…
Reference in New Issue