Skip to content

Instantly share code, notes, and snippets.

@zao
Created April 17, 2014 14:21
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save zao/10987174 to your computer and use it in GitHub Desktop.
Save zao/10987174 to your computer and use it in GitHub Desktop.
Phoenix new
#include <boost/phoenix.hpp>
struct C {
};
struct B {
C foo() { C c; return c; }
};
struct A {
explicit A(C const& c) {}
};
int main()
{
namespace phx = boost::phoenix;
B b;
phx::new_<A>(phx::bind(&B::foo, phx::ref(b)))();
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment