cgal/Installation/test/Installation/test_use_h.cpp

34 lines
678 B
C++
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

#include <CGAL/use.h>
template <typename T>
struct Foo {
typedef typename T::fake fake;
// Fake typedef to check that Foo<double> is not instantiated.
};
int test_use_type()
{
typedef Foo<double> type;
// If the following line is commented, g++-4.8 -Wall displays that
// warning:
// typedef type locally defined but not used [-Wunused-local-typedefs]
CGAL_USE_TYPE(type);
return 0;
}
int test_use() {
int unused = 0;
// If the following line is commented, g++-4.8 -Wall displays that
// warning:
// unused variable unused [-Wunused-variable]
CGAL_USE(unused);
return 0;
}
int main() {
return test_use_type() + test_use();
}