]> git.lyx.org Git - lyx.git/blobdiff - src/support/lyxfunctional.h
lyx-devel.diff
[lyx.git] / src / support / lyxfunctional.h
index 50d7ed22432d9fb0a6f806f3e9d513786c168847..55382cc0818c4b6bbf46067bbfe539d65daa6475 100644 (file)
@@ -3,10 +3,18 @@
 #ifndef LYX_FUNCTIONAL_H
 #define LYX_FUNCTIONAL_H
 
+/** \file lyxfunctional.h
+    \brief Convenient function objects for use with LyX
+    
+    This is currently a small collection of small function objects for use
+    together with std::algorithms.
+**/
+
 #include <iterator>
 
 //namespace lyx {
 
+
 template<class R, class C, class A>
 class class_fun_t {
 public:
@@ -34,7 +42,16 @@ private:
        void(C::*cmf)(A);
 };
 
-       
+
+/// Use to call a class method with a container element.
+/** Most easily used as a functor to std::algoritms.
+    Small example:
+    \verbatim
+    A a; // class that have a int print(string const &) method
+    vector<string> vs;
+    for_each(vs.begin(), vs.end(), class_fun(int, vs, &A::print);
+    \endverbatim
+**/
 template <class R, class C, class A> class_fun_t<R, C, A>
 class_fun(C & c, R(C::*f)(A))
 {