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

mysql - How to enter php data into a html multiple select box -

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

c++ - Cassandra datastax cpp driver - avoiding unnecessary copies -