Team Fortress 2 Source Code as on 22/4/2020
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

29 lines
768 B

  1. /**
  2. * @file std_functors.i
  3. * @date Sun May 6 00:44:33 2007
  4. *
  5. * @brief This file provides unary and binary functors for STL
  6. * containers, that will invoke a Ruby proc or method to do
  7. * their operation.
  8. *
  9. * You can use them in a swig file like:
  10. *
  11. * %include <std_set.i>
  12. * %include <std_functors.i>
  13. *
  14. * %template< IntSet > std::set< int, swig::BinaryPredicate<int> >;
  15. *
  16. *
  17. * which will then allow calling them from Ruby either like:
  18. *
  19. * # order of set is defined by C++ default
  20. * a = IntSet.new
  21. *
  22. * # sort order defined by Ruby proc
  23. * b = IntSet.new( proc { |a,b| a > b } )
  24. *
  25. */
  26. %include <rubystdfunctors.swg>
  27. %fragment("StdFunctors");