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 -

asp.net mvc - How to attach sql database to a javascript graph -

c# - How to know the number of Threads created and limit the Tasks accordingly -