c++ - boost bind or lambda functor that returns a constant -


Can I use the bind or boost lambda library to promote: that ignores its arguments and always Provides a stability?

For example an abusive physician:

  complete return three (some type ARG) {return 3; }  

Sure, use

  boost :: Phoenix :: Val (3);  

See this

  #include & lt; Boost / phoenix.hpp & gt; Namespace P = Promotion: Phoenix; Namespace P: using arg_names; Int main () {auto p = p :: val (42); Return P () + P (/ * Ignored: * / 77); }  

which returns 84 as the exitcode.


Comments

Popular posts from this blog

java - Can't add JTree to JPanel of a JInternalFrame -

javascript - data.match(var) not working it seems -

javascript - How can I pause a jQuery .each() loop, while waiting for user input? -