3
0
mirror of https://github.com/triqs/dft_tools synced 2024-12-26 06:14:14 +01:00
dft_tools/test/triqs/clef_examples/simple.cpp
Olivier Parcollet f2c7d449cc First commit : triqs libs version 1.0 alpha1
for earlier commits, see TRIQS0.x repository.
2013-07-17 19:24:07 +02:00

19 lines
429 B
C++

#include "triqs/clef.hpp"
namespace tql = triqs::clef;
// This macro just prints its argument literaly, and then its value
#define PRINT(X) std::cout << BOOST_PP_STRINGIZE((X)) << " ---> "<< (X) <<std::endl;
int main() {
tql::placeholder <1> x_;
tql::placeholder <2> y_;
PRINT ( x_ + 2*y_ );
PRINT (eval(x_ + 2*y_ , x_ = 1, y_ = 2));
PRINT (eval(x_ + 2*y_ , x_ = 1));
PRINT (eval(x_ + 2*y_ , x_ = x_ + y_));
}