#include <CGAL/Coercion_traits.h>
#include <CGAL/Quotient.h>
#include <CGAL/Sqrt_extension.h>
#include <CGAL/IO/io.h>
template <typename A, typename B>
binary_function_(const A& a , const B& b, CGAL::Tag_false){
std::cout << "Call for ExplicitInteroperable types: " << std::endl;
typename CT::Cast cast;
return cast(a)*cast(b);
}
template <typename A, typename B>
binary_function_(const A& a , const B& b, CGAL::Tag_true){
std::cout << "Call for ImpicitInteroperable types: " << std::endl;
return a*b;
}
template <typename A, typename B>
binary_func(const A& a , const B& b){
typedef typename CT::Are_implicit_interoperable Are_implicit_interoperable;
return binary_function_(a,b,Are_implicit_interoperable());
}
int main(){
CGAL::IO::set_pretty_mode(std::cout);
std::cout<< binary_func(double(3), int(5)) << std::endl;
CGAL::Quotient<int> rational(1,3);
CGAL::Sqrt_extension<int,int> extension(1,2,3);
CGAL::Sqrt_extension<CGAL::Quotient<int>,int> result = binary_func(rational, extension);
std::cout<< result << std::endl;
return 0;
}
An instance of Coercion_traits reflects the type coercion of the types A and B, it is symmetric in th...
Definition Coercion_traits.h:15
unspecified_type Type
The coercion type of A and B.
Definition Coercion_traits.h:39