I always thought Boost.Phoenix used type-output to do everything statically until I tried this code:
#include <vector> #include <boost/phoenix/phoenix.hpp> using namespace boost::phoenix; using namespace boost::phoenix::placeholders; struct Foo { int x; }; int main() { std::vector<int> bar; bind(&Foo::x, ref(bar)[_1])("invalid index"); // oops return 0; }
and received a warning:
warning C4239: non-standard extension is used: 'argument': conversion from const char [3]
to volatile const boost::proto::detail::anyns::any &
A non-constant link can only be bound to an lvalue
It surprised me. I did not expect to see any
anywhere, much less volatile
!
Does this mean that Boost.Phoenix is ββactually inherently slower than its equivalent C ++ 11 lambdas (ignoring the specific compiler that I use here)?
source share