2
0
mirror of https://github.com/boostorg/yap.git synced 2026-02-22 16:02:10 +00:00
Files
yap/doc/other_snippets.cpp
2016-12-12 21:56:51 -06:00

22 lines
278 B
C++

#include <boost/yap/expression.hpp>
#include <iostream>
void foo ()
{
//[ assign_through_terminal
int i = 0;
auto expr = boost::yap::make_terminal(i) = 42;
evaluate(expr);
std::cout << i << "\n"; // Prints 42.
//]
}
int main ()
{
foo();
return 0;
}