Brian Silverman | ce4aa8d | 2018-08-04 23:36:03 -0700 | [diff] [blame^] | 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 | |
| 10 | [section:implementation Implementation] |
| 11 | |
| 12 | [section Files] |
| 13 | |
| 14 | * [@../../../../boost/mem_fn.hpp boost/mem_fn.hpp] (main header) |
| 15 | * [@../../../../boost/bind/mem_fn_cc.hpp boost/bind/mem_fn_cc.hpp] (used by `mem_fn.hpp`, do not include directly) |
| 16 | * [@../../../../boost/bind/mem_fn_vw.hpp boost/bind/mem_fn_vw.hpp] (used by `mem_fn.hpp`, do not include directly) |
| 17 | * [@../../../../boost/bind/mem_fn_template.hpp boost/bind/mem_fn_template.hpp] (used by `mem_fn.hpp`, do not include directly) |
| 18 | * [@../../test/mem_fn_test.cpp libs/bind/test/mem_fn_test.cpp] (test) |
| 19 | * [@../../test/mem_fn_derived_test.cpp libs/bind/test/mem_fn_derived_test.cpp] (test with derived objects) |
| 20 | * [@../../test/mem_fn_fastcall_test.cpp libs/bind/test/mem_fn_fastcall_test.cpp] (test for `__fastcall`) |
| 21 | * [@../../test/mem_fn_stdcall_test.cpp libs/bind/test/mem_fn_stdcall_test.cpp] (test for `__stdcall`) |
| 22 | * [@../../test/mem_fn_void_test.cpp libs/bind/test/mem_fn_void_test.cpp] (test for `void` returns) |
| 23 | |
| 24 | [endsect] |
| 25 | |
| 26 | [section Dependencies] |
| 27 | |
| 28 | * [@boost:/libs/config/config.htm Boost.Config] |
| 29 | |
| 30 | [endsect] |
| 31 | |
| 32 | [section Number of Arguments] |
| 33 | |
| 34 | This implementation supports member functions with up to eight arguments. This |
| 35 | is not an inherent limitation of the design, but an implementation detail. |
| 36 | |
| 37 | [endsect] |
| 38 | |
| 39 | [section:stdcall `__stdcall`, `__cdecl`, and `__fastcall` Support] |
| 40 | |
| 41 | Some platforms allow several types of member functions that differ by their |
| 42 | calling convention (the rules by which the function is invoked: how are |
| 43 | arguments passed, how is the return value handled, and who cleans up the stack |
| 44 | - if any.) |
| 45 | |
| 46 | For example, Windows API functions and COM interface member functions use a |
| 47 | calling convention known as `__stdcall`. Borland VCL components use |
| 48 | `__fastcall`. UDK, the component model of OpenOffice.org, uses `__cdecl`. |
| 49 | |
| 50 | To use `mem_fn` with `__stdcall` member functions, `#define` the macro |
| 51 | `BOOST_MEM_FN_ENABLE_STDCALL` before including `<boost/mem_fn.hpp>`. |
| 52 | |
| 53 | To use `mem_fn` with `__fastcall` member functions, `#define` the macro |
| 54 | `BOOST_MEM_FN_ENABLE_FASTCALL` before including `<boost/mem_fn.hpp>`. |
| 55 | |
| 56 | To use `mem_fn` with `__cdecl` member functions, `#define` the macro |
| 57 | `BOOST_MEM_FN_ENABLE_CDECL` before including `<boost/mem_fn.hpp>`. |
| 58 | |
| 59 | [*It is best to define these macros in the project options, via `-D` on the |
| 60 | command line, or as the first line in the translation unit (.cpp file) where |
| 61 | `mem_fn` is used.] Not following this rule can lead to obscure errors when a |
| 62 | header includes `mem_fn.hpp` before the macro has been defined. |
| 63 | |
| 64 | /[Note:/ this is a non-portable extension. It is not part of the interface./]/ |
| 65 | |
| 66 | /[Note:/ Some compilers provide only minimal support for the `__stdcall` keyword./]/ |
| 67 | |
| 68 | [endsect] |
| 69 | |
| 70 | [endsect] |