implementation.qbk 2.9 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970
  1. [/
  2. / Copyright (c) 2001, 2002 Peter Dimov and Multi Media Ltd.
  3. / Copyright (c) 2003-2005 Peter Dimov
  4. /
  5. / Distributed under the Boost Software License, Version 1.0. (See
  6. / accompanying file LICENSE_1_0.txt or copy at
  7. / http://www.boost.org/LICENSE_1_0.txt)
  8. /]
  9. [section:implementation Implementation]
  10. [section Files]
  11. * [@../../../../boost/mem_fn.hpp boost/mem_fn.hpp] (main header)
  12. * [@../../../../boost/bind/mem_fn_cc.hpp boost/bind/mem_fn_cc.hpp] (used by `mem_fn.hpp`, do not include directly)
  13. * [@../../../../boost/bind/mem_fn_vw.hpp boost/bind/mem_fn_vw.hpp] (used by `mem_fn.hpp`, do not include directly)
  14. * [@../../../../boost/bind/mem_fn_template.hpp boost/bind/mem_fn_template.hpp] (used by `mem_fn.hpp`, do not include directly)
  15. * [@../../test/mem_fn_test.cpp libs/bind/test/mem_fn_test.cpp] (test)
  16. * [@../../test/mem_fn_derived_test.cpp libs/bind/test/mem_fn_derived_test.cpp] (test with derived objects)
  17. * [@../../test/mem_fn_fastcall_test.cpp libs/bind/test/mem_fn_fastcall_test.cpp] (test for `__fastcall`)
  18. * [@../../test/mem_fn_stdcall_test.cpp libs/bind/test/mem_fn_stdcall_test.cpp] (test for `__stdcall`)
  19. * [@../../test/mem_fn_void_test.cpp libs/bind/test/mem_fn_void_test.cpp] (test for `void` returns)
  20. [endsect]
  21. [section Dependencies]
  22. * [@boost:/libs/config/config.htm Boost.Config]
  23. [endsect]
  24. [section Number of Arguments]
  25. This implementation supports member functions with up to eight arguments. This
  26. is not an inherent limitation of the design, but an implementation detail.
  27. [endsect]
  28. [section:stdcall `__stdcall`, `__cdecl`, and `__fastcall` Support]
  29. Some platforms allow several types of member functions that differ by their
  30. calling convention (the rules by which the function is invoked: how are
  31. arguments passed, how is the return value handled, and who cleans up the stack
  32. - if any.)
  33. For example, Windows API functions and COM interface member functions use a
  34. calling convention known as `__stdcall`. Borland VCL components use
  35. `__fastcall`. UDK, the component model of OpenOffice.org, uses `__cdecl`.
  36. To use `mem_fn` with `__stdcall` member functions, `#define` the macro
  37. `BOOST_MEM_FN_ENABLE_STDCALL` before including `<boost/mem_fn.hpp>`.
  38. To use `mem_fn` with `__fastcall` member functions, `#define` the macro
  39. `BOOST_MEM_FN_ENABLE_FASTCALL` before including `<boost/mem_fn.hpp>`.
  40. To use `mem_fn` with `__cdecl` member functions, `#define` the macro
  41. `BOOST_MEM_FN_ENABLE_CDECL` before including `<boost/mem_fn.hpp>`.
  42. [*It is best to define these macros in the project options, via `-D` on the
  43. command line, or as the first line in the translation unit (.cpp file) where
  44. `mem_fn` is used.] Not following this rule can lead to obscure errors when a
  45. header includes `mem_fn.hpp` before the macro has been defined.
  46. /[Note:/ this is a non-portable extension. It is not part of the interface./]/
  47. /[Note:/ Some compilers provide only minimal support for the `__stdcall` keyword./]/
  48. [endsect]
  49. [endsect]