3
0
mirror of https://github.com/triqs/dft_tools synced 2024-10-31 19:23:45 +01:00
dft_tools/test/triqs/gfs/wrap_tech.cpp
2013-09-06 17:51:51 +02:00

24 lines
387 B
C++

#include <iostream>
struct infty {};
template<typename T> struct wrap {
T x;
wrap(T const & x_): x(x_) {}
operator infty() const { return infty();}
operator T () const { return x;}
};
double g(infty) { return 3;}
double f(double) { return 30;}
int main() {
wrap<double> w(2);
std::cout << w +1 <<std::endl;
std::cout << g(w) <<std::endl;
std::cout << f(w) <<std::endl;
}