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.

1924 lines
65 KiB

  1. /* /////////////////////////////////////////////////////////////////////////
  2. * File: stlsoft/functional/method_adaptors.hpp (originally ::SynesisStd)
  3. *
  4. * Purpose: Contains the stlsoft::mem_fun calling convention-aware function adaptors.
  5. *
  6. * Created: 13th June 1999
  7. * Updated: 10th August 2009
  8. *
  9. * Home: http://stlsoft.org/
  10. *
  11. * Copyright (c) 1999-2009, Matthew Wilson and Synesis Software
  12. * All rights reserved.
  13. *
  14. * Redistribution and use in source and binary forms, with or without
  15. * modification, are permitted provided that the following conditions are met:
  16. *
  17. * - Redistributions of source code must retain the above copyright notice, this
  18. * list of conditions and the following disclaimer.
  19. * - Redistributions in binary form must reproduce the above copyright notice,
  20. * this list of conditions and the following disclaimer in the documentation
  21. * and/or other materials provided with the distribution.
  22. * - Neither the name(s) of Matthew Wilson and Synesis Software nor the names of
  23. * any contributors may be used to endorse or promote products derived from
  24. * this software without specific prior written permission.
  25. *
  26. * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
  27. * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
  28. * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
  29. * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
  30. * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
  31. * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
  32. * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
  33. * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
  34. * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
  35. * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
  36. * POSSIBILITY OF SUCH DAMAGE.
  37. *
  38. * ////////////////////////////////////////////////////////////////////// */
  39. /** \file stlsoft/functional/method_adaptors.hpp
  40. *
  41. * \brief [C++ only] Function classes that adapt member functions (and
  42. * handle different calling conventions), and their creator functions:
  43. * stlsoft::mem_fun() and stlsoft::mem_fun_ref()
  44. * (\ref group__library__functional "Functional" Library).
  45. */
  46. #ifndef STLSOFT_INCL_STLSOFT_FUNCTIONAL_HPP_METHOD_ADAPTORS
  47. #define STLSOFT_INCL_STLSOFT_FUNCTIONAL_HPP_METHOD_ADAPTORS
  48. #ifndef STLSOFT_DOCUMENTATION_SKIP_SECTION
  49. # define STLSOFT_VER_STLSOFT_FUNCTIONAL_HPP_METHOD_ADAPTORS_MAJOR 4
  50. # define STLSOFT_VER_STLSOFT_FUNCTIONAL_HPP_METHOD_ADAPTORS_MINOR 1
  51. # define STLSOFT_VER_STLSOFT_FUNCTIONAL_HPP_METHOD_ADAPTORS_REVISION 3
  52. # define STLSOFT_VER_STLSOFT_FUNCTIONAL_HPP_METHOD_ADAPTORS_EDIT 62
  53. #endif /* !STLSOFT_DOCUMENTATION_SKIP_SECTION */
  54. /* /////////////////////////////////////////////////////////////////////////
  55. * Auto-generation and compatibility
  56. */
  57. /*
  58. [Incompatibilies-start]
  59. STLSOFT_COMPILER_IS_GCC: __GNUC__ < 3 || (__GNUC__ == 3 && __GNUC_MINOR__ < 4)
  60. [Incompatibilies-end]
  61. */
  62. /* /////////////////////////////////////////////////////////////////////////
  63. * Includes
  64. */
  65. #ifndef STLSOFT_INCL_STLSOFT_H_STLSOFT
  66. # include <stlsoft/stlsoft.h>
  67. #endif /* !STLSOFT_INCL_STLSOFT_H_STLSOFT */
  68. #if defined(STLSOFT_COMPILER_IS_GCC) && \
  69. ( __GNUC__ < 3 || \
  70. ( __GNUC__ == 3 && \
  71. __GNUC_MINOR__ < 3))
  72. # error This file is not compatible with GCC <3.3
  73. #endif /* compiler */
  74. #ifndef STLSOFT_INCL_FUNCTIONAL
  75. # define STLSOFT_INCL_FUNCTIONAL
  76. # include <functional>
  77. #endif /* !STLSOFT_INCL_FUNCTIONAL */
  78. /* /////////////////////////////////////////////////////////////////////////
  79. * Namespace
  80. */
  81. #ifndef _STLSOFT_NO_NAMESPACE
  82. namespace stlsoft
  83. {
  84. #endif /* _STLSOFT_NO_NAMESPACE */
  85. /* /////////////////////////////////////////////////////////////////////////
  86. * Classes
  87. */
  88. // thiscall
  89. #ifdef STLSOFT_CF_THISCALL_SUPPORTED
  90. /** \brief A function class that invokes a <b>cdecl</b> calling convention
  91. * 0-parameter mutating (non-const) member function on its pointer argument.
  92. *
  93. * \ingroup group__library__functional
  94. */
  95. // [[synesis:class:function-class:unary-function: thiscall_mem_fun_t<T<R>, T<A>>]]
  96. template< ss_typename_param_k R
  97. , ss_typename_param_k T
  98. >
  99. struct thiscall_mem_fun_t
  100. : public stlsoft_ns_qual_std(unary_function)<T*, R>
  101. {
  102. public:
  103. typedef R return_type;
  104. typedef T operand_class_type;
  105. typedef return_type (T::*method_type)();
  106. public:
  107. ss_explicit_k thiscall_mem_fun_t(method_type func)
  108. : m_func(func)
  109. {}
  110. return_type operator ()(operand_class_type *pt) const
  111. {
  112. return (pt->*m_func)();
  113. }
  114. private:
  115. method_type m_func;
  116. };
  117. /** \brief A function class that invokes a <b>cdecl</b> calling convention
  118. * 0-parameter non-mutating (const) member function on its pointer argument.
  119. *
  120. * \ingroup group__library__functional
  121. */
  122. // [[synesis:class:function-class:unary-function: thiscall_mem_fun_t<T<R>, T<A>>]]
  123. template< ss_typename_param_k R
  124. , ss_typename_param_k T
  125. >
  126. struct thiscall_mem_fun_const_t
  127. : public stlsoft_ns_qual_std(unary_function)<T*, R>
  128. {
  129. public:
  130. typedef R return_type;
  131. typedef T operand_class_type;
  132. # ifdef STLSOFT_CF_CALLING_CONVENTION_OUTSIDE_BRACE_REQUIRED
  133. typedef return_type (T::*method_type)() const;
  134. # else /* ? STLSOFT_CF_CALLING_CONVENTION_OUTSIDE_BRACE_REQUIRED */
  135. typedef return_type (T::*method_type)() const;
  136. # endif /* STLSOFT_CF_CALLING_CONVENTION_OUTSIDE_BRACE_REQUIRED */
  137. public:
  138. ss_explicit_k thiscall_mem_fun_const_t(method_type func)
  139. : m_func(func)
  140. {}
  141. return_type operator ()(operand_class_type const* pt) const
  142. {
  143. return (pt->*m_func)();
  144. }
  145. private:
  146. method_type m_func;
  147. };
  148. # ifndef STLSOFT_CF_COMPILER_SUPPORTS_RETURN_VOID
  149. template< ss_typename_param_k T
  150. >
  151. struct thiscall_mem_fun_void_t
  152. : public stlsoft_ns_qual_std(unary_function)<T*, void>
  153. {
  154. public:
  155. typedef void return_type;
  156. typedef T operand_class_type;
  157. # ifdef STLSOFT_CF_CALLING_CONVENTION_OUTSIDE_BRACE_REQUIRED
  158. typedef return_type (T::*method_type)();
  159. # else /* ? STLSOFT_CF_CALLING_CONVENTION_OUTSIDE_BRACE_REQUIRED */
  160. typedef return_type (T::*method_type)();
  161. # endif /* STLSOFT_CF_CALLING_CONVENTION_OUTSIDE_BRACE_REQUIRED */
  162. public:
  163. ss_explicit_k thiscall_mem_fun_void_t(method_type func)
  164. : m_func(func)
  165. {}
  166. void operator ()(operand_class_type *pt) const
  167. {
  168. (pt->*m_func)();
  169. }
  170. private:
  171. method_type m_func;
  172. };
  173. template< ss_typename_param_k T
  174. >
  175. struct thiscall_mem_fun_const_void_t
  176. : public stlsoft_ns_qual_std(unary_function)<T*, void>
  177. {
  178. public:
  179. typedef void return_type;
  180. typedef T operand_class_type;
  181. typedef return_type (T::*method_type)() const;
  182. public:
  183. ss_explicit_k thiscall_mem_fun_const_void_t(method_type func)
  184. : m_func(func)
  185. {}
  186. void operator ()(operand_class_type const* pt) const
  187. {
  188. (pt->*m_func)();
  189. }
  190. private:
  191. method_type m_func;
  192. };
  193. # endif /* STLSOFT_CF_COMPILER_SUPPORTS_RETURN_VOID */
  194. #endif /* STLSOFT_CF_THISCALL_SUPPORTED */
  195. // cdecl
  196. #ifdef STLSOFT_CF_CDECL_SUPPORTED
  197. /** \brief A function class that invokes a <b>cdecl</b> calling convention
  198. * 0-parameter mutating (non-const) member function on its pointer argument.
  199. *
  200. * \ingroup group__library__functional
  201. */
  202. // [[synesis:class:function-class:unary-function: cdecl_mem_fun_t<T<R>, T<A>>]]
  203. template< ss_typename_param_k R
  204. , ss_typename_param_k T
  205. >
  206. struct cdecl_mem_fun_t
  207. : public stlsoft_ns_qual_std(unary_function)<T*, R>
  208. {
  209. public:
  210. typedef R return_type;
  211. typedef T operand_class_type;
  212. # ifdef STLSOFT_CF_CALLING_CONVENTION_OUTSIDE_BRACE_REQUIRED
  213. typedef return_type STLSOFT_CDECL (T::*method_type)();
  214. # else /* ? STLSOFT_CF_CALLING_CONVENTION_OUTSIDE_BRACE_REQUIRED */
  215. typedef return_type (STLSOFT_CDECL T::*method_type)();
  216. # endif /* STLSOFT_CF_CALLING_CONVENTION_OUTSIDE_BRACE_REQUIRED */
  217. public:
  218. ss_explicit_k cdecl_mem_fun_t(method_type func)
  219. : m_func(func)
  220. {}
  221. return_type operator ()(operand_class_type *pt) const
  222. {
  223. return (pt->*m_func)();
  224. }
  225. private:
  226. method_type m_func;
  227. };
  228. /** \brief A function class that invokes a <b>cdecl</b> calling convention
  229. * 0-parameter non-mutating (const) member function on its pointer argument.
  230. *
  231. * \ingroup group__library__functional
  232. */
  233. // [[synesis:class:function-class:unary-function: cdecl_mem_fun_t<T<R>, T<A>>]]
  234. template< ss_typename_param_k R
  235. , ss_typename_param_k T
  236. >
  237. struct cdecl_mem_fun_const_t
  238. : public stlsoft_ns_qual_std(unary_function)<T*, R>
  239. {
  240. public:
  241. typedef R return_type;
  242. typedef T operand_class_type;
  243. # ifdef STLSOFT_CF_CALLING_CONVENTION_OUTSIDE_BRACE_REQUIRED
  244. typedef return_type STLSOFT_CDECL (T::*method_type)() const;
  245. # else /* ? STLSOFT_CF_CALLING_CONVENTION_OUTSIDE_BRACE_REQUIRED */
  246. typedef return_type (STLSOFT_CDECL T::*method_type)() const;
  247. # endif /* STLSOFT_CF_CALLING_CONVENTION_OUTSIDE_BRACE_REQUIRED */
  248. public:
  249. ss_explicit_k cdecl_mem_fun_const_t(method_type func)
  250. : m_func(func)
  251. {}
  252. return_type operator ()(operand_class_type const* pt) const
  253. {
  254. return (pt->*m_func)();
  255. }
  256. private:
  257. method_type m_func;
  258. };
  259. # ifndef STLSOFT_CF_COMPILER_SUPPORTS_RETURN_VOID
  260. template< ss_typename_param_k T
  261. >
  262. struct cdecl_mem_fun_void_t
  263. : public stlsoft_ns_qual_std(unary_function)<T*, void>
  264. {
  265. public:
  266. typedef void return_type;
  267. typedef T operand_class_type;
  268. # ifdef STLSOFT_CF_CALLING_CONVENTION_OUTSIDE_BRACE_REQUIRED
  269. typedef return_type STLSOFT_CDECL (T::*method_type)();
  270. # else /* ? STLSOFT_CF_CALLING_CONVENTION_OUTSIDE_BRACE_REQUIRED */
  271. typedef return_type (STLSOFT_CDECL T::*method_type)();
  272. # endif /* STLSOFT_CF_CALLING_CONVENTION_OUTSIDE_BRACE_REQUIRED */
  273. public:
  274. ss_explicit_k cdecl_mem_fun_void_t(method_type func)
  275. : m_func(func)
  276. {}
  277. void operator ()(operand_class_type *pt) const
  278. {
  279. (pt->*m_func)();
  280. }
  281. private:
  282. method_type m_func;
  283. };
  284. template< ss_typename_param_k T
  285. >
  286. struct cdecl_mem_fun_const_void_t
  287. : public stlsoft_ns_qual_std(unary_function)<T*, void>
  288. {
  289. public:
  290. typedef void return_type;
  291. typedef T operand_class_type;
  292. # ifdef STLSOFT_CF_CALLING_CONVENTION_OUTSIDE_BRACE_REQUIRED
  293. typedef return_type STLSOFT_CDECL (T::*method_type)() const;
  294. # else /* ? STLSOFT_CF_CALLING_CONVENTION_OUTSIDE_BRACE_REQUIRED */
  295. typedef return_type (STLSOFT_CDECL T::*method_type)() const;
  296. # endif /* STLSOFT_CF_CALLING_CONVENTION_OUTSIDE_BRACE_REQUIRED */
  297. public:
  298. ss_explicit_k cdecl_mem_fun_const_void_t(method_type func)
  299. : m_func(func)
  300. {}
  301. void operator ()(operand_class_type const* pt) const
  302. {
  303. (pt->*m_func)();
  304. }
  305. private:
  306. method_type m_func;
  307. };
  308. # endif /* STLSOFT_CF_COMPILER_SUPPORTS_RETURN_VOID */
  309. #endif /* STLSOFT_CF_CDECL_SUPPORTED */
  310. // fastcall
  311. #ifdef STLSOFT_CF_FASTCALL_SUPPORTED
  312. /** \brief A function class that invokes a <b>fastcall</b> calling convention
  313. * 0-parameter mutating (non-const) member function on its pointer argument.
  314. *
  315. * \ingroup group__library__functional
  316. */
  317. // [[synesis:class:function-class:unary-function: fastcall_mem_fun_t<T<R>, T<A>>]]
  318. template< ss_typename_param_k R
  319. , ss_typename_param_k T
  320. >
  321. struct fastcall_mem_fun_t
  322. : public stlsoft_ns_qual_std(unary_function)<T*, R>
  323. {
  324. public:
  325. typedef R return_type;
  326. typedef T operand_class_type;
  327. #ifdef STLSOFT_CF_CALLING_CONVENTION_OUTSIDE_BRACE_REQUIRED
  328. typedef return_type STLSOFT_FASTCALL (T::*method_type)();
  329. #else /* ? STLSOFT_CF_CALLING_CONVENTION_OUTSIDE_BRACE_REQUIRED */
  330. typedef return_type (STLSOFT_FASTCALL T::*method_type)();
  331. #endif /* STLSOFT_CF_CALLING_CONVENTION_OUTSIDE_BRACE_REQUIRED */
  332. public:
  333. ss_explicit_k fastcall_mem_fun_t(method_type func)
  334. : m_func(func)
  335. {}
  336. return_type operator ()(operand_class_type *pt) const
  337. {
  338. return (pt->*m_func)();
  339. }
  340. private:
  341. method_type m_func;
  342. };
  343. /** \brief A function class that invokes a <b>fastcall</b> calling convention
  344. * 0-parameter non-mutating (const) member function on its pointer argument.
  345. *
  346. * \ingroup group__library__functional
  347. */
  348. // [[synesis:class:function-class:unary-function: fastcall_mem_fun_t<T<R>, T<A>>]]
  349. template< ss_typename_param_k R
  350. , ss_typename_param_k T
  351. >
  352. struct fastcall_mem_fun_const_t
  353. : public stlsoft_ns_qual_std(unary_function)<T*, R>
  354. {
  355. public:
  356. typedef R return_type;
  357. typedef T operand_class_type;
  358. #ifdef STLSOFT_CF_CALLING_CONVENTION_OUTSIDE_BRACE_REQUIRED
  359. typedef return_type STLSOFT_FASTCALL (T::*method_type)() const;
  360. #else /* ? STLSOFT_CF_CALLING_CONVENTION_OUTSIDE_BRACE_REQUIRED */
  361. typedef return_type (STLSOFT_FASTCALL T::*method_type)() const;
  362. #endif /* STLSOFT_CF_CALLING_CONVENTION_OUTSIDE_BRACE_REQUIRED */
  363. public:
  364. ss_explicit_k fastcall_mem_fun_const_t(method_type func)
  365. : m_func(func)
  366. {}
  367. return_type operator ()(operand_class_type const* pt) const
  368. {
  369. return (pt->*m_func)();
  370. }
  371. private:
  372. method_type m_func;
  373. };
  374. # ifndef STLSOFT_CF_COMPILER_SUPPORTS_RETURN_VOID
  375. template< ss_typename_param_k T
  376. >
  377. struct fastcall_mem_fun_void_t
  378. : public stlsoft_ns_qual_std(unary_function)<T*, void>
  379. {
  380. public:
  381. typedef void return_type;
  382. typedef T operand_class_type;
  383. #ifdef STLSOFT_CF_CALLING_CONVENTION_OUTSIDE_BRACE_REQUIRED
  384. typedef return_type STLSOFT_FASTCALL (T::*method_type)();
  385. #else /* ? STLSOFT_CF_CALLING_CONVENTION_OUTSIDE_BRACE_REQUIRED */
  386. typedef return_type (STLSOFT_FASTCALL T::*method_type)();
  387. #endif /* STLSOFT_CF_CALLING_CONVENTION_OUTSIDE_BRACE_REQUIRED */
  388. public:
  389. ss_explicit_k fastcall_mem_fun_void_t(method_type func)
  390. : m_func(func)
  391. {}
  392. void operator ()(operand_class_type *pt) const
  393. {
  394. (pt->*m_func)();
  395. }
  396. private:
  397. method_type m_func;
  398. };
  399. template< ss_typename_param_k T
  400. >
  401. struct fastcall_mem_fun_const_void_t
  402. : public stlsoft_ns_qual_std(unary_function)<T*, void>
  403. {
  404. public:
  405. typedef void return_type;
  406. typedef T operand_class_type;
  407. #ifdef STLSOFT_CF_CALLING_CONVENTION_OUTSIDE_BRACE_REQUIRED
  408. typedef return_type STLSOFT_FASTCALL (T::*method_type)() const;
  409. #else /* ? STLSOFT_CF_CALLING_CONVENTION_OUTSIDE_BRACE_REQUIRED */
  410. typedef return_type (STLSOFT_FASTCALL T::*method_type)() const;
  411. #endif /* STLSOFT_CF_CALLING_CONVENTION_OUTSIDE_BRACE_REQUIRED */
  412. public:
  413. ss_explicit_k fastcall_mem_fun_const_void_t(method_type func)
  414. : m_func(func)
  415. {}
  416. void operator ()(operand_class_type const* pt) const
  417. {
  418. (pt->*m_func)();
  419. }
  420. private:
  421. method_type m_func;
  422. };
  423. # endif /* STLSOFT_CF_COMPILER_SUPPORTS_RETURN_VOID */
  424. #endif /* STLSOFT_CF_FASTCALL_SUPPORTED */
  425. // stdcall
  426. #ifdef STLSOFT_CF_STDCALL_SUPPORTED
  427. /** \brief A function class that invokes a <b>stdcall</b> calling convention
  428. * 0-parameter mutating (non-const) member function on its pointer argument.
  429. *
  430. * \ingroup group__library__functional
  431. */
  432. // [[synesis:class:function-class:unary-function: stdcall_mem_fun_t<T<T>, T<A>>]]
  433. template< ss_typename_param_k R
  434. , ss_typename_param_k T
  435. >
  436. struct stdcall_mem_fun_t
  437. : public stlsoft_ns_qual_std(unary_function)<T*, R>
  438. {
  439. public:
  440. typedef R return_type;
  441. typedef T operand_class_type;
  442. #ifdef STLSOFT_CF_CALLING_CONVENTION_OUTSIDE_BRACE_REQUIRED
  443. typedef return_type STLSOFT_STDCALL (T::*method_type)();
  444. #else /* ? STLSOFT_CF_CALLING_CONVENTION_OUTSIDE_BRACE_REQUIRED */
  445. typedef return_type (STLSOFT_STDCALL T::*method_type)();
  446. #endif /* STLSOFT_CF_CALLING_CONVENTION_OUTSIDE_BRACE_REQUIRED */
  447. public:
  448. ss_explicit_k stdcall_mem_fun_t(method_type func)
  449. : m_func(func)
  450. {}
  451. return_type operator ()(operand_class_type *pt) const
  452. {
  453. return (pt->*m_func)();
  454. }
  455. private:
  456. method_type m_func;
  457. };
  458. /** \brief A function class that invokes a <b>stdcall</b> calling convention
  459. * 0-parameter non-mutating (const) member function on its pointer argument.
  460. *
  461. * \ingroup group__library__functional
  462. */
  463. // [[synesis:class:function-class:unary-function: stdcall_mem_fun_t<T<T>, T<A>>]]
  464. template< ss_typename_param_k R
  465. , ss_typename_param_k T
  466. >
  467. struct stdcall_mem_fun_const_t
  468. : public stlsoft_ns_qual_std(unary_function)<T*, R>
  469. {
  470. public:
  471. typedef R return_type;
  472. typedef T operand_class_type;
  473. #ifdef STLSOFT_CF_CALLING_CONVENTION_OUTSIDE_BRACE_REQUIRED
  474. typedef return_type STLSOFT_STDCALL (T::*method_type)() const;
  475. #else /* ? STLSOFT_CF_CALLING_CONVENTION_OUTSIDE_BRACE_REQUIRED */
  476. typedef return_type (STLSOFT_STDCALL T::*method_type)() const;
  477. #endif /* STLSOFT_CF_CALLING_CONVENTION_OUTSIDE_BRACE_REQUIRED */
  478. public:
  479. ss_explicit_k stdcall_mem_fun_const_t(method_type func)
  480. : m_func(func)
  481. {}
  482. return_type operator ()(operand_class_type const* pt) const
  483. {
  484. return (pt->*m_func)();
  485. }
  486. private:
  487. method_type m_func;
  488. };
  489. # ifndef STLSOFT_CF_COMPILER_SUPPORTS_RETURN_VOID
  490. template< ss_typename_param_k T
  491. >
  492. struct stdcall_mem_fun_void_t
  493. : public stlsoft_ns_qual_std(unary_function)<T*, void>
  494. {
  495. public:
  496. typedef void return_type;
  497. typedef T operand_class_type;
  498. #ifdef STLSOFT_CF_CALLING_CONVENTION_OUTSIDE_BRACE_REQUIRED
  499. typedef return_type STLSOFT_STDCALL (T::*method_type)();
  500. #else /* ? STLSOFT_CF_CALLING_CONVENTION_OUTSIDE_BRACE_REQUIRED */
  501. typedef return_type (STLSOFT_STDCALL T::*method_type)();
  502. #endif /* STLSOFT_CF_CALLING_CONVENTION_OUTSIDE_BRACE_REQUIRED */
  503. public:
  504. ss_explicit_k stdcall_mem_fun_void_t(method_type func)
  505. : m_func(func)
  506. {}
  507. void operator ()(operand_class_type *pt) const
  508. {
  509. (pt->*m_func)();
  510. }
  511. private:
  512. method_type m_func;
  513. };
  514. template< ss_typename_param_k T
  515. >
  516. struct stdcall_mem_fun_const_void_t
  517. : public stlsoft_ns_qual_std(unary_function)<T*, void>
  518. {
  519. public:
  520. typedef void return_type;
  521. typedef T operand_class_type;
  522. #ifdef STLSOFT_CF_CALLING_CONVENTION_OUTSIDE_BRACE_REQUIRED
  523. typedef return_type STLSOFT_STDCALL (T::*method_type)() const;
  524. #else /* ? STLSOFT_CF_CALLING_CONVENTION_OUTSIDE_BRACE_REQUIRED */
  525. typedef return_type (STLSOFT_STDCALL T::*method_type)() const;
  526. #endif /* STLSOFT_CF_CALLING_CONVENTION_OUTSIDE_BRACE_REQUIRED */
  527. public:
  528. ss_explicit_k stdcall_mem_fun_const_void_t(method_type func)
  529. : m_func(func)
  530. {}
  531. void operator ()(operand_class_type const* pt) const
  532. {
  533. (pt->*m_func)();
  534. }
  535. private:
  536. method_type m_func;
  537. };
  538. # endif /* STLSOFT_CF_COMPILER_SUPPORTS_RETURN_VOID */
  539. #endif /* STLSOFT_CF_STDCALL_SUPPORTED */
  540. #ifdef STLSOFT_CF_THISCALL_SUPPORTED
  541. /** \brief A function class that invokes a <b>cdecl</b> calling convention
  542. * 0-parameter mutating (non-const) member function on its pointer argument.
  543. *
  544. * \ingroup group__library__functional
  545. */
  546. // [[synesis:class:function-class:unary-function: thiscall_mem_fun_ref_t<T<R>, T<A>>]]
  547. template< ss_typename_param_k R
  548. , ss_typename_param_k T
  549. >
  550. struct thiscall_mem_fun_ref_t
  551. : public stlsoft_ns_qual_std(unary_function)<T*, R>
  552. {
  553. public:
  554. typedef R return_type;
  555. typedef T operand_class_type;
  556. typedef return_type (T::*method_type)();
  557. public:
  558. ss_explicit_k thiscall_mem_fun_ref_t(method_type func)
  559. : m_func(func)
  560. {}
  561. return_type operator ()(operand_class_type& rt) const
  562. {
  563. return (rt.*m_func)();
  564. }
  565. private:
  566. method_type m_func;
  567. };
  568. /** \brief A function class that invokes a <b>thiscall</b> calling convention
  569. * 0-parameter non-mutating (const) member function on its pointer argument.
  570. *
  571. * \ingroup group__library__functional
  572. */
  573. // [[synesis:class:function-class:unary-function: thiscall_mem_fun_ref_t<T<R>, T<A>>]]
  574. template< ss_typename_param_k R
  575. , ss_typename_param_k T
  576. >
  577. struct thiscall_mem_fun_ref_const_t
  578. : public stlsoft_ns_qual_std(unary_function)<T*, R>
  579. {
  580. public:
  581. typedef R return_type;
  582. typedef T operand_class_type;
  583. typedef return_type (T::*method_type)() const;
  584. public:
  585. ss_explicit_k thiscall_mem_fun_ref_const_t(method_type func)
  586. : m_func(func)
  587. {}
  588. return_type operator ()(operand_class_type const& rt) const
  589. {
  590. return (rt.*m_func)();
  591. }
  592. private:
  593. method_type m_func;
  594. };
  595. # ifndef STLSOFT_CF_COMPILER_SUPPORTS_RETURN_VOID
  596. template< ss_typename_param_k T
  597. >
  598. struct thiscall_mem_fun_ref_void_t
  599. : public stlsoft_ns_qual_std(unary_function)<T*, void>
  600. {
  601. public:
  602. typedef void return_type;
  603. typedef T operand_class_type;
  604. typedef return_type (T::*method_type)();
  605. public:
  606. ss_explicit_k thiscall_mem_fun_ref_void_t(method_type func)
  607. : m_func(func)
  608. {}
  609. void operator ()(operand_class_type& rt) const
  610. {
  611. (rt.*m_func)();
  612. }
  613. private:
  614. method_type m_func;
  615. };
  616. template< ss_typename_param_k T
  617. >
  618. struct thiscall_mem_fun_ref_const_void_t
  619. : public stlsoft_ns_qual_std(unary_function)<T*, void>
  620. {
  621. public:
  622. typedef void return_type;
  623. typedef T operand_class_type;
  624. typedef return_type (T::*method_type)() const;
  625. public:
  626. ss_explicit_k thiscall_mem_fun_ref_const_void_t(method_type func)
  627. : m_func(func)
  628. {}
  629. void operator ()(operand_class_type const& rt) const
  630. {
  631. (rt.*m_func)();
  632. }
  633. private:
  634. method_type m_func;
  635. };
  636. # endif /* STLSOFT_CF_COMPILER_SUPPORTS_RETURN_VOID */
  637. #endif /* STLSOFT_CF_THISCALL_SUPPORTED */
  638. #ifdef STLSOFT_CF_CDECL_SUPPORTED
  639. /** \brief A function class that invokes a <b>cdecl</b> calling convention
  640. * 0-parameter mutating (non-const) member function on its pointer argument.
  641. *
  642. * \ingroup group__library__functional
  643. */
  644. // [[synesis:class:function-class:unary-function: cdecl_mem_fun_ref_t<T<R>, T<A>>]]
  645. template< ss_typename_param_k R
  646. , ss_typename_param_k T
  647. >
  648. struct cdecl_mem_fun_ref_t
  649. : public stlsoft_ns_qual_std(unary_function)<T*, R>
  650. {
  651. public:
  652. typedef R return_type;
  653. typedef T operand_class_type;
  654. # ifdef STLSOFT_CF_CALLING_CONVENTION_OUTSIDE_BRACE_REQUIRED
  655. typedef return_type STLSOFT_CDECL (T::*method_type)();
  656. # else /* ? STLSOFT_CF_CALLING_CONVENTION_OUTSIDE_BRACE_REQUIRED */
  657. typedef return_type (STLSOFT_CDECL T::*method_type)();
  658. # endif /* STLSOFT_CF_CALLING_CONVENTION_OUTSIDE_BRACE_REQUIRED */
  659. public:
  660. ss_explicit_k cdecl_mem_fun_ref_t(method_type func)
  661. : m_func(func)
  662. {}
  663. return_type operator ()(operand_class_type& rt) const
  664. {
  665. return (rt.*m_func)();
  666. }
  667. private:
  668. method_type m_func;
  669. };
  670. /** \brief A function class that invokes a <b>cdecl</b> calling convention
  671. * 0-parameter non-mutating (const) member function on its pointer argument.
  672. *
  673. * \ingroup group__library__functional
  674. */
  675. // [[synesis:class:function-class:unary-function: cdecl_mem_fun_ref_t<T<R>, T<A>>]]
  676. template< ss_typename_param_k R
  677. , ss_typename_param_k T
  678. >
  679. struct cdecl_mem_fun_ref_const_t
  680. : public stlsoft_ns_qual_std(unary_function)<T*, R>
  681. {
  682. public:
  683. typedef R return_type;
  684. typedef T operand_class_type;
  685. # ifdef STLSOFT_CF_CALLING_CONVENTION_OUTSIDE_BRACE_REQUIRED
  686. typedef return_type STLSOFT_CDECL (T::*method_type)() const;
  687. # else /* ? STLSOFT_CF_CALLING_CONVENTION_OUTSIDE_BRACE_REQUIRED */
  688. typedef return_type (STLSOFT_CDECL T::*method_type)() const;
  689. # endif /* STLSOFT_CF_CALLING_CONVENTION_OUTSIDE_BRACE_REQUIRED */
  690. public:
  691. ss_explicit_k cdecl_mem_fun_ref_const_t(method_type func)
  692. : m_func(func)
  693. {}
  694. return_type operator ()(operand_class_type const& rt) const
  695. {
  696. return (rt.*m_func)();
  697. }
  698. private:
  699. method_type m_func;
  700. };
  701. # ifndef STLSOFT_CF_COMPILER_SUPPORTS_RETURN_VOID
  702. template< ss_typename_param_k T
  703. >
  704. struct cdecl_mem_fun_ref_void_t
  705. : public stlsoft_ns_qual_std(unary_function)<T*, void>
  706. {
  707. public:
  708. typedef void return_type;
  709. typedef T operand_class_type;
  710. # ifdef STLSOFT_CF_CALLING_CONVENTION_OUTSIDE_BRACE_REQUIRED
  711. typedef return_type STLSOFT_CDECL (T::*method_type)();
  712. # else /* ? STLSOFT_CF_CALLING_CONVENTION_OUTSIDE_BRACE_REQUIRED */
  713. typedef return_type (STLSOFT_CDECL T::*method_type)();
  714. # endif /* STLSOFT_CF_CALLING_CONVENTION_OUTSIDE_BRACE_REQUIRED */
  715. public:
  716. ss_explicit_k cdecl_mem_fun_ref_void_t(method_type func)
  717. : m_func(func)
  718. {}
  719. void operator ()(operand_class_type& rt) const
  720. {
  721. (rt.*m_func)();
  722. }
  723. private:
  724. method_type m_func;
  725. };
  726. template< ss_typename_param_k T
  727. >
  728. struct cdecl_mem_fun_ref_const_void_t
  729. : public stlsoft_ns_qual_std(unary_function)<T*, void>
  730. {
  731. public:
  732. typedef void return_type;
  733. typedef T operand_class_type;
  734. # ifdef STLSOFT_CF_CALLING_CONVENTION_OUTSIDE_BRACE_REQUIRED
  735. typedef return_type STLSOFT_CDECL (T::*method_type)() const;
  736. # else /* ? STLSOFT_CF_CALLING_CONVENTION_OUTSIDE_BRACE_REQUIRED */
  737. typedef return_type (STLSOFT_CDECL T::*method_type)() const;
  738. # endif /* STLSOFT_CF_CALLING_CONVENTION_OUTSIDE_BRACE_REQUIRED */
  739. public:
  740. ss_explicit_k cdecl_mem_fun_ref_const_void_t(method_type func)
  741. : m_func(func)
  742. {}
  743. void operator ()(operand_class_type const& rt) const
  744. {
  745. (rt.*m_func)();
  746. }
  747. private:
  748. method_type m_func;
  749. };
  750. # endif /* STLSOFT_CF_COMPILER_SUPPORTS_RETURN_VOID */
  751. #endif /* STLSOFT_CF_CDECL_SUPPORTED */
  752. #ifdef STLSOFT_CF_FASTCALL_SUPPORTED
  753. /** \brief A function class that invokes a <b>fastcall</b> calling convention
  754. * 0-parameter mutating (non-const) member function on its pointer argument.
  755. *
  756. * \ingroup group__library__functional
  757. */
  758. // [[synesis:class:function-class:unary-function: fastcall_mem_fun_ref_t<T<R>, T<A>>]]
  759. template< ss_typename_param_k R
  760. , ss_typename_param_k T
  761. >
  762. struct fastcall_mem_fun_ref_t
  763. : public stlsoft_ns_qual_std(unary_function)<T*, R>
  764. {
  765. public:
  766. typedef R return_type;
  767. typedef T operand_class_type;
  768. #ifdef STLSOFT_CF_CALLING_CONVENTION_OUTSIDE_BRACE_REQUIRED
  769. typedef return_type STLSOFT_FASTCALL (T::*method_type)();
  770. #else /* ? STLSOFT_CF_CALLING_CONVENTION_OUTSIDE_BRACE_REQUIRED */
  771. typedef return_type (STLSOFT_FASTCALL T::*method_type)();
  772. #endif /* STLSOFT_CF_CALLING_CONVENTION_OUTSIDE_BRACE_REQUIRED */
  773. public:
  774. ss_explicit_k fastcall_mem_fun_ref_t(method_type func)
  775. : m_func(func)
  776. {}
  777. return_type operator ()(operand_class_type& rt) const
  778. {
  779. return (rt.*m_func)();
  780. }
  781. private:
  782. method_type m_func;
  783. };
  784. /** \brief A function class that invokes a <b>fastcall</b> calling convention
  785. * 0-parameter non-mutating (const) member function on its pointer argument.
  786. *
  787. * \ingroup group__library__functional
  788. */
  789. // [[synesis:class:function-class:unary-function: fastcall_mem_fun_ref_t<T<R>, T<A>>]]
  790. template< ss_typename_param_k R
  791. , ss_typename_param_k T
  792. >
  793. struct fastcall_mem_fun_ref_const_t
  794. : public stlsoft_ns_qual_std(unary_function)<T*, R>
  795. {
  796. public:
  797. typedef R return_type;
  798. typedef T operand_class_type;
  799. #ifdef STLSOFT_CF_CALLING_CONVENTION_OUTSIDE_BRACE_REQUIRED
  800. typedef return_type STLSOFT_FASTCALL (T::*method_type)() const;
  801. #else /* ? STLSOFT_CF_CALLING_CONVENTION_OUTSIDE_BRACE_REQUIRED */
  802. typedef return_type (STLSOFT_FASTCALL T::*method_type)() const;
  803. #endif /* STLSOFT_CF_CALLING_CONVENTION_OUTSIDE_BRACE_REQUIRED */
  804. public:
  805. ss_explicit_k fastcall_mem_fun_ref_const_t(method_type func)
  806. : m_func(func)
  807. {}
  808. return_type operator ()(operand_class_type const& rt) const
  809. {
  810. return (rt.*m_func)();
  811. }
  812. private:
  813. method_type m_func;
  814. };
  815. # ifndef STLSOFT_CF_COMPILER_SUPPORTS_RETURN_VOID
  816. template< ss_typename_param_k T
  817. >
  818. struct fastcall_mem_fun_ref_void_t
  819. : public stlsoft_ns_qual_std(unary_function)<T*, void>
  820. {
  821. public:
  822. typedef void return_type;
  823. typedef T operand_class_type;
  824. #ifdef STLSOFT_CF_CALLING_CONVENTION_OUTSIDE_BRACE_REQUIRED
  825. typedef return_type STLSOFT_FASTCALL (T::*method_type)();
  826. #else /* ? STLSOFT_CF_CALLING_CONVENTION_OUTSIDE_BRACE_REQUIRED */
  827. typedef return_type (STLSOFT_FASTCALL T::*method_type)();
  828. #endif /* STLSOFT_CF_CALLING_CONVENTION_OUTSIDE_BRACE_REQUIRED */
  829. public:
  830. ss_explicit_k fastcall_mem_fun_ref_void_t(method_type func)
  831. : m_func(func)
  832. {}
  833. void operator ()(operand_class_type& rt) const
  834. {
  835. (rt.*m_func)();
  836. }
  837. private:
  838. method_type m_func;
  839. };
  840. template< ss_typename_param_k T
  841. >
  842. struct fastcall_mem_fun_ref_const_void_t
  843. : public stlsoft_ns_qual_std(unary_function)<T*, void>
  844. {
  845. public:
  846. typedef void return_type;
  847. typedef T operand_class_type;
  848. #ifdef STLSOFT_CF_CALLING_CONVENTION_OUTSIDE_BRACE_REQUIRED
  849. typedef return_type STLSOFT_FASTCALL (T::*method_type)() const;
  850. #else /* ? STLSOFT_CF_CALLING_CONVENTION_OUTSIDE_BRACE_REQUIRED */
  851. typedef return_type (STLSOFT_FASTCALL T::*method_type)() const;
  852. #endif /* STLSOFT_CF_CALLING_CONVENTION_OUTSIDE_BRACE_REQUIRED */
  853. public:
  854. ss_explicit_k fastcall_mem_fun_ref_const_void_t(method_type func)
  855. : m_func(func)
  856. {}
  857. void operator ()(operand_class_type const& rt) const
  858. {
  859. (rt.*m_func)();
  860. }
  861. private:
  862. method_type m_func;
  863. };
  864. # endif /* STLSOFT_CF_COMPILER_SUPPORTS_RETURN_VOID */
  865. #endif /* STLSOFT_CF_FASTCALL_SUPPORTED */
  866. #ifdef STLSOFT_CF_STDCALL_SUPPORTED
  867. /** \brief A function class that invokes a <b>stdcall</b> calling convention
  868. * 0-parameter mutating (non-const) member function on its pointer argument.
  869. *
  870. * \ingroup group__library__functional
  871. */
  872. // [[synesis:class:function-class:unary-function: stdcall_mem_fun_ref_t<T<T>, T<A>>]]
  873. template< ss_typename_param_k R
  874. , ss_typename_param_k T
  875. >
  876. struct stdcall_mem_fun_ref_t
  877. : public stlsoft_ns_qual_std(unary_function)<T*, R>
  878. {
  879. public:
  880. typedef R return_type;
  881. typedef T operand_class_type;
  882. #ifdef STLSOFT_CF_CALLING_CONVENTION_OUTSIDE_BRACE_REQUIRED
  883. typedef return_type STLSOFT_STDCALL (T::*method_type)();
  884. #else /* ? STLSOFT_CF_CALLING_CONVENTION_OUTSIDE_BRACE_REQUIRED */
  885. typedef return_type (STLSOFT_STDCALL T::*method_type)();
  886. #endif /* STLSOFT_CF_CALLING_CONVENTION_OUTSIDE_BRACE_REQUIRED */
  887. public:
  888. ss_explicit_k stdcall_mem_fun_ref_t(method_type func)
  889. : m_func(func)
  890. {}
  891. return_type operator ()(operand_class_type& rt) const
  892. {
  893. return (rt.*m_func)();
  894. }
  895. private:
  896. method_type m_func;
  897. };
  898. /** \brief A function class that invokes a <b>stdcall</b> calling convention
  899. * 0-parameter non-mutating (const) member function on its pointer argument.
  900. *
  901. * \ingroup group__library__functional
  902. */
  903. // [[synesis:class:function-class:unary-function: stdcall_mem_fun_ref_t<T<T>, T<A>>]]
  904. template< ss_typename_param_k R
  905. , ss_typename_param_k T
  906. >
  907. struct stdcall_mem_fun_ref_const_t
  908. : public stlsoft_ns_qual_std(unary_function)<T*, R>
  909. {
  910. public:
  911. typedef R return_type;
  912. typedef T operand_class_type;
  913. #ifdef STLSOFT_CF_CALLING_CONVENTION_OUTSIDE_BRACE_REQUIRED
  914. typedef return_type STLSOFT_STDCALL (T::*method_type)() const;
  915. #else /* ? STLSOFT_CF_CALLING_CONVENTION_OUTSIDE_BRACE_REQUIRED */
  916. typedef return_type (STLSOFT_STDCALL T::*method_type)() const;
  917. #endif /* STLSOFT_CF_CALLING_CONVENTION_OUTSIDE_BRACE_REQUIRED */
  918. public:
  919. ss_explicit_k stdcall_mem_fun_ref_const_t(method_type func)
  920. : m_func(func)
  921. {}
  922. return_type operator ()(operand_class_type const& rt) const
  923. {
  924. return (rt.*m_func)();
  925. }
  926. private:
  927. method_type m_func;
  928. };
  929. # ifndef STLSOFT_CF_COMPILER_SUPPORTS_RETURN_VOID
  930. template< ss_typename_param_k T
  931. >
  932. struct stdcall_mem_fun_ref_void_t
  933. : public stlsoft_ns_qual_std(unary_function)<T*, void>
  934. {
  935. public:
  936. typedef void return_type;
  937. typedef T operand_class_type;
  938. #ifdef STLSOFT_CF_CALLING_CONVENTION_OUTSIDE_BRACE_REQUIRED
  939. typedef return_type STLSOFT_STDCALL (T::*method_type)();
  940. #else /* ? STLSOFT_CF_CALLING_CONVENTION_OUTSIDE_BRACE_REQUIRED */
  941. typedef return_type (STLSOFT_STDCALL T::*method_type)();
  942. #endif /* STLSOFT_CF_CALLING_CONVENTION_OUTSIDE_BRACE_REQUIRED */
  943. public:
  944. ss_explicit_k stdcall_mem_fun_ref_void_t(method_type func)
  945. : m_func(func)
  946. {}
  947. void operator ()(operand_class_type& rt) const
  948. {
  949. (rt.*m_func)();
  950. }
  951. private:
  952. method_type m_func;
  953. };
  954. template< ss_typename_param_k T
  955. >
  956. struct stdcall_mem_fun_ref_const_void_t
  957. : public stlsoft_ns_qual_std(unary_function)<T*, void>
  958. {
  959. public:
  960. typedef void return_type;
  961. typedef T operand_class_type;
  962. #ifdef STLSOFT_CF_CALLING_CONVENTION_OUTSIDE_BRACE_REQUIRED
  963. typedef return_type STLSOFT_STDCALL (T::*method_type)() const;
  964. #else /* ? STLSOFT_CF_CALLING_CONVENTION_OUTSIDE_BRACE_REQUIRED */
  965. typedef return_type (STLSOFT_STDCALL T::*method_type)() const;
  966. #endif /* STLSOFT_CF_CALLING_CONVENTION_OUTSIDE_BRACE_REQUIRED */
  967. public:
  968. ss_explicit_k stdcall_mem_fun_ref_const_void_t(method_type func)
  969. : m_func(func)
  970. {}
  971. void operator ()(operand_class_type const& rt) const
  972. {
  973. (rt.*m_func)();
  974. }
  975. private:
  976. method_type m_func;
  977. };
  978. # endif /* STLSOFT_CF_COMPILER_SUPPORTS_RETURN_VOID */
  979. #endif /* STLSOFT_CF_STDCALL_SUPPORTED */
  980. /* /////////////////////////////////////////////////////////////////////////
  981. * Creator functions
  982. */
  983. // cdecl
  984. #ifdef STLSOFT_CF_CDECL_SUPPORTED
  985. /** \brief Creator function to adapt a pointer to a 0-parameter mutating
  986. * (non-const) member function, for use with a pointer to the class.
  987. *
  988. * \ingroup group__library__functional
  989. */
  990. template< ss_typename_param_k R
  991. , ss_typename_param_k T
  992. >
  993. #ifdef STLSOFT_CF_CALLING_CONVENTION_OUTSIDE_BRACE_REQUIRED
  994. inline cdecl_mem_fun_t<R, T> mem_fun(R (T::*STLSOFT_CDECL func)())
  995. #else /* ? STLSOFT_CF_CALLING_CONVENTION_OUTSIDE_BRACE_REQUIRED */
  996. inline cdecl_mem_fun_t<R, T> mem_fun(R (STLSOFT_CDECL T::*func)())
  997. #endif /* STLSOFT_CF_CALLING_CONVENTION_OUTSIDE_BRACE_REQUIRED */
  998. {
  999. return cdecl_mem_fun_t<R, T>(func);
  1000. }
  1001. #if defined(STLSOFT_CF_COMPILER_SUPPORTS_RETURN_VOID)
  1002. /* We just provide mem_fun_void() that returns 'normal' type. */
  1003. template< ss_typename_param_k T
  1004. >
  1005. #ifdef STLSOFT_CF_CALLING_CONVENTION_OUTSIDE_BRACE_REQUIRED
  1006. inline cdecl_mem_fun_t<void, T> mem_fun_void(void (T::*STLSOFT_CDECL func)())
  1007. #else /* ? STLSOFT_CF_CALLING_CONVENTION_OUTSIDE_BRACE_REQUIRED */
  1008. inline cdecl_mem_fun_t<void, T> mem_fun_void(void (STLSOFT_CDECL T::*func)())
  1009. #endif /* STLSOFT_CF_CALLING_CONVENTION_OUTSIDE_BRACE_REQUIRED */
  1010. {
  1011. return cdecl_mem_fun_t<void, T>(func);
  1012. }
  1013. #else /* ? STLSOFT_CF_COMPILER_SUPPORTS_RETURN_VOID */
  1014. template< ss_typename_param_k T
  1015. >
  1016. #ifdef STLSOFT_CF_CALLING_CONVENTION_OUTSIDE_BRACE_REQUIRED
  1017. inline cdecl_mem_fun_void_t<T> mem_fun(void (T::*STLSOFT_CDECL func)())
  1018. #else /* ? STLSOFT_CF_CALLING_CONVENTION_OUTSIDE_BRACE_REQUIRED */
  1019. inline cdecl_mem_fun_void_t<T> mem_fun(void (STLSOFT_CDECL T::*func)())
  1020. #endif /* STLSOFT_CF_CALLING_CONVENTION_OUTSIDE_BRACE_REQUIRED */
  1021. {
  1022. return cdecl_mem_fun_void_t<T>(func);
  1023. }
  1024. template< ss_typename_param_k T
  1025. >
  1026. #ifdef STLSOFT_CF_CALLING_CONVENTION_OUTSIDE_BRACE_REQUIRED
  1027. inline cdecl_mem_fun_void_t<T> mem_fun_void(void (T::*STLSOFT_CDECL func)())
  1028. #else /* ? STLSOFT_CF_CALLING_CONVENTION_OUTSIDE_BRACE_REQUIRED */
  1029. inline cdecl_mem_fun_void_t<T> mem_fun_void(void (STLSOFT_CDECL T::*func)())
  1030. #endif /* STLSOFT_CF_CALLING_CONVENTION_OUTSIDE_BRACE_REQUIRED */
  1031. {
  1032. return cdecl_mem_fun_void_t<T>(func);
  1033. }
  1034. #endif /* STLSOFT_CF_COMPILER_SUPPORTS_RETURN_VOID */
  1035. /** \brief Creator function to adapt a pointer to a 0-parameter non-mutating
  1036. * (const) member function, for use with a pointer to the class.
  1037. *
  1038. * \ingroup group__library__functional
  1039. */
  1040. template< ss_typename_param_k R
  1041. , ss_typename_param_k T
  1042. >
  1043. #ifdef STLSOFT_CF_CALLING_CONVENTION_OUTSIDE_BRACE_REQUIRED
  1044. inline cdecl_mem_fun_const_t<R, T> mem_fun(R (T::*STLSOFT_CDECL func)() const)
  1045. #else /* ? STLSOFT_CF_CALLING_CONVENTION_OUTSIDE_BRACE_REQUIRED */
  1046. inline cdecl_mem_fun_const_t<R, T> mem_fun(R (STLSOFT_CDECL T::*func)() const)
  1047. #endif /* STLSOFT_CF_CALLING_CONVENTION_OUTSIDE_BRACE_REQUIRED */
  1048. {
  1049. return cdecl_mem_fun_const_t<R, T>(func);
  1050. }
  1051. #if defined(STLSOFT_CF_COMPILER_SUPPORTS_RETURN_VOID)
  1052. /* We just provide mem_fun_const_void() that returns 'normal' type. */
  1053. template< ss_typename_param_k T
  1054. >
  1055. #ifdef STLSOFT_CF_CALLING_CONVENTION_OUTSIDE_BRACE_REQUIRED
  1056. inline cdecl_mem_fun_const_t<void, T> mem_fun_void(void (T::*STLSOFT_CDECL func)() const)
  1057. #else /* ? STLSOFT_CF_CALLING_CONVENTION_OUTSIDE_BRACE_REQUIRED */
  1058. inline cdecl_mem_fun_const_t<void, T> mem_fun_void(void (STLSOFT_CDECL T::*func)() const)
  1059. #endif /* STLSOFT_CF_CALLING_CONVENTION_OUTSIDE_BRACE_REQUIRED */
  1060. {
  1061. return cdecl_mem_fun_const_t<void, T>(func);
  1062. }
  1063. #else /* ? STLSOFT_CF_COMPILER_SUPPORTS_RETURN_VOID */
  1064. template< ss_typename_param_k T
  1065. >
  1066. #ifdef STLSOFT_CF_CALLING_CONVENTION_OUTSIDE_BRACE_REQUIRED
  1067. inline cdecl_mem_fun_const_void_t<T> mem_fun(void (T::*STLSOFT_CDECL func)() const)
  1068. #else /* ? STLSOFT_CF_CALLING_CONVENTION_OUTSIDE_BRACE_REQUIRED */
  1069. inline cdecl_mem_fun_const_void_t<T> mem_fun(void (STLSOFT_CDECL T::*func)() const)
  1070. #endif /* STLSOFT_CF_CALLING_CONVENTION_OUTSIDE_BRACE_REQUIRED */
  1071. {
  1072. return cdecl_mem_fun_const_void_t<T>(func);
  1073. }
  1074. template< ss_typename_param_k T
  1075. >
  1076. #ifdef STLSOFT_CF_CALLING_CONVENTION_OUTSIDE_BRACE_REQUIRED
  1077. inline cdecl_mem_fun_const_void_t<T> mem_fun_void(void (T::*STLSOFT_CDECL func)() const)
  1078. #else /* ? STLSOFT_CF_CALLING_CONVENTION_OUTSIDE_BRACE_REQUIRED */
  1079. inline cdecl_mem_fun_const_void_t<T> mem_fun_void(void (STLSOFT_CDECL T::*func)() const)
  1080. #endif /* STLSOFT_CF_CALLING_CONVENTION_OUTSIDE_BRACE_REQUIRED */
  1081. {
  1082. return cdecl_mem_fun_const_void_t<T>(func);
  1083. }
  1084. #endif /* STLSOFT_CF_COMPILER_SUPPORTS_RETURN_VOID */
  1085. #endif /* STLSOFT_CF_CDECL_SUPPORTED */
  1086. // fastcall
  1087. #ifdef STLSOFT_CF_FASTCALL_SUPPORTED
  1088. /** \brief Creator function to adapt a pointer to a 0-parameter mutating
  1089. * (non-const) member function, for use with a pointer to the class.
  1090. *
  1091. * \ingroup group__library__functional
  1092. */
  1093. template< ss_typename_param_k R
  1094. , ss_typename_param_k T
  1095. >
  1096. #ifdef STLSOFT_CF_CALLING_CONVENTION_OUTSIDE_BRACE_REQUIRED
  1097. inline fastcall_mem_fun_t<R, T> mem_fun(R (T::*STLSOFT_FASTCALL func)())
  1098. #else /* ? STLSOFT_CF_CALLING_CONVENTION_OUTSIDE_BRACE_REQUIRED */
  1099. inline fastcall_mem_fun_t<R, T> mem_fun(R (STLSOFT_FASTCALL T::*func)())
  1100. #endif /* STLSOFT_CF_CALLING_CONVENTION_OUTSIDE_BRACE_REQUIRED */
  1101. {
  1102. return fastcall_mem_fun_t<R, T>(func);
  1103. }
  1104. # if defined(STLSOFT_CF_COMPILER_SUPPORTS_RETURN_VOID)
  1105. /* We just provide mem_fun_void() that returns 'normal' type. */
  1106. template< ss_typename_param_k T
  1107. >
  1108. #ifdef STLSOFT_CF_CALLING_CONVENTION_OUTSIDE_BRACE_REQUIRED
  1109. inline fastcall_mem_fun_t<void, T> mem_fun_void(void (T::*STLSOFT_FASTCALL func)())
  1110. #else /* ? STLSOFT_CF_CALLING_CONVENTION_OUTSIDE_BRACE_REQUIRED */
  1111. inline fastcall_mem_fun_t<void, T> mem_fun_void(void (STLSOFT_FASTCALL T::*func)())
  1112. #endif /* STLSOFT_CF_CALLING_CONVENTION_OUTSIDE_BRACE_REQUIRED */
  1113. {
  1114. return fastcall_mem_fun_t<void, T>(func);
  1115. }
  1116. # else /* ? STLSOFT_CF_COMPILER_SUPPORTS_RETURN_VOID */
  1117. template< ss_typename_param_k T
  1118. >
  1119. #ifdef STLSOFT_CF_CALLING_CONVENTION_OUTSIDE_BRACE_REQUIRED
  1120. inline fastcall_mem_fun_void_t<T> mem_fun(void (T::*STLSOFT_FASTCALL func)())
  1121. #else /* ? STLSOFT_CF_CALLING_CONVENTION_OUTSIDE_BRACE_REQUIRED */
  1122. inline fastcall_mem_fun_void_t<T> mem_fun(void (STLSOFT_FASTCALL T::*func)())
  1123. #endif /* STLSOFT_CF_CALLING_CONVENTION_OUTSIDE_BRACE_REQUIRED */
  1124. {
  1125. return fastcall_mem_fun_void_t<T>(func);
  1126. }
  1127. template< ss_typename_param_k T
  1128. >
  1129. #ifdef STLSOFT_CF_CALLING_CONVENTION_OUTSIDE_BRACE_REQUIRED
  1130. inline fastcall_mem_fun_void_t<T> mem_fun_void(void (T::*STLSOFT_FASTCALL func)())
  1131. #else /* ? STLSOFT_CF_CALLING_CONVENTION_OUTSIDE_BRACE_REQUIRED */
  1132. inline fastcall_mem_fun_void_t<T> mem_fun_void(void (STLSOFT_FASTCALL T::*func)())
  1133. #endif /* STLSOFT_CF_CALLING_CONVENTION_OUTSIDE_BRACE_REQUIRED */
  1134. {
  1135. return fastcall_mem_fun_void_t<T>(func);
  1136. }
  1137. # endif /* STLSOFT_CF_COMPILER_SUPPORTS_RETURN_VOID */
  1138. #endif /* STLSOFT_CF_FASTCALL_SUPPORTED */
  1139. /** \brief Creator function to adapt a pointer to a 0-parameter non-mutating
  1140. * (const) member function, for use with a pointer to the class.
  1141. *
  1142. * \ingroup group__library__functional
  1143. */
  1144. #ifdef STLSOFT_CF_FASTCALL_SUPPORTED
  1145. template< ss_typename_param_k R
  1146. , ss_typename_param_k T
  1147. >
  1148. #ifdef STLSOFT_CF_CALLING_CONVENTION_OUTSIDE_BRACE_REQUIRED
  1149. inline fastcall_mem_fun_const_t<R, T> mem_fun(R (T::*STLSOFT_FASTCALL func)() const)
  1150. #else /* ? STLSOFT_CF_CALLING_CONVENTION_OUTSIDE_BRACE_REQUIRED */
  1151. inline fastcall_mem_fun_const_t<R, T> mem_fun(R (STLSOFT_FASTCALL T::*func)() const)
  1152. #endif /* STLSOFT_CF_CALLING_CONVENTION_OUTSIDE_BRACE_REQUIRED */
  1153. {
  1154. return fastcall_mem_fun_const_t<R, T>(func);
  1155. }
  1156. # if defined(STLSOFT_CF_COMPILER_SUPPORTS_RETURN_VOID)
  1157. /* We just provide mem_fun_void() that returns 'normal' type. */
  1158. template< ss_typename_param_k T
  1159. >
  1160. #ifdef STLSOFT_CF_CALLING_CONVENTION_OUTSIDE_BRACE_REQUIRED
  1161. inline fastcall_mem_fun_const_t<void, T> mem_fun_void(void (T::*STLSOFT_FASTCALL func)() const)
  1162. #else /* ? STLSOFT_CF_CALLING_CONVENTION_OUTSIDE_BRACE_REQUIRED */
  1163. inline fastcall_mem_fun_const_t<void, T> mem_fun_void(void (STLSOFT_FASTCALL T::*func)() const)
  1164. #endif /* STLSOFT_CF_CALLING_CONVENTION_OUTSIDE_BRACE_REQUIRED */
  1165. {
  1166. return fastcall_mem_fun_const_t<void, T>(func);
  1167. }
  1168. # else /* ? STLSOFT_CF_COMPILER_SUPPORTS_RETURN_VOID */
  1169. template< ss_typename_param_k T
  1170. >
  1171. #ifdef STLSOFT_CF_CALLING_CONVENTION_OUTSIDE_BRACE_REQUIRED
  1172. inline fastcall_mem_fun_const_void_t<T> mem_fun(void (T::*STLSOFT_FASTCALL func)() const)
  1173. #else /* ? STLSOFT_CF_CALLING_CONVENTION_OUTSIDE_BRACE_REQUIRED */
  1174. inline fastcall_mem_fun_const_void_t<T> mem_fun(void (STLSOFT_FASTCALL T::*func)() const)
  1175. #endif /* STLSOFT_CF_CALLING_CONVENTION_OUTSIDE_BRACE_REQUIRED */
  1176. {
  1177. return fastcall_mem_fun_const_void_t<T>(func);
  1178. }
  1179. template< ss_typename_param_k T
  1180. >
  1181. #ifdef STLSOFT_CF_CALLING_CONVENTION_OUTSIDE_BRACE_REQUIRED
  1182. inline fastcall_mem_fun_const_void_t<T> mem_fun_void(void (T::*STLSOFT_FASTCALL func)() const)
  1183. #else /* ? STLSOFT_CF_CALLING_CONVENTION_OUTSIDE_BRACE_REQUIRED */
  1184. inline fastcall_mem_fun_const_void_t<T> mem_fun_void(void (STLSOFT_FASTCALL T::*func)() const)
  1185. #endif /* STLSOFT_CF_CALLING_CONVENTION_OUTSIDE_BRACE_REQUIRED */
  1186. {
  1187. return fastcall_mem_fun_const_void_t<T>(func);
  1188. }
  1189. # endif /* STLSOFT_CF_COMPILER_SUPPORTS_RETURN_VOID */
  1190. #endif /* STLSOFT_CF_FASTCALL_SUPPORTED */
  1191. // stdcall
  1192. /** \brief Creator function to adapt a pointer to a 0-parameter mutating
  1193. * (non-const) member function, for use with a pointer to the class.
  1194. *
  1195. * \ingroup group__library__functional
  1196. */
  1197. #ifdef STLSOFT_CF_STDCALL_SUPPORTED
  1198. template< ss_typename_param_k R
  1199. , ss_typename_param_k T
  1200. >
  1201. #ifdef STLSOFT_CF_CALLING_CONVENTION_OUTSIDE_BRACE_REQUIRED
  1202. inline stdcall_mem_fun_t<R, T> mem_fun(R (T::*STLSOFT_STDCALL func)())
  1203. #else /* ? STLSOFT_CF_CALLING_CONVENTION_OUTSIDE_BRACE_REQUIRED */
  1204. inline stdcall_mem_fun_t<R, T> mem_fun(R (STLSOFT_STDCALL T::*func)())
  1205. #endif /* STLSOFT_CF_CALLING_CONVENTION_OUTSIDE_BRACE_REQUIRED */
  1206. {
  1207. return stdcall_mem_fun_t<R, T>(func);
  1208. }
  1209. # if defined(STLSOFT_CF_COMPILER_SUPPORTS_RETURN_VOID)
  1210. /* We just provide mem_fun_void() that returns 'normal' type. */
  1211. template< ss_typename_param_k T
  1212. >
  1213. #ifdef STLSOFT_CF_CALLING_CONVENTION_OUTSIDE_BRACE_REQUIRED
  1214. inline stdcall_mem_fun_t<void, T> mem_fun_void(void (T::*STLSOFT_STDCALL func)())
  1215. #else /* ? STLSOFT_CF_CALLING_CONVENTION_OUTSIDE_BRACE_REQUIRED */
  1216. inline stdcall_mem_fun_t<void, T> mem_fun_void(void (STLSOFT_STDCALL T::*func)())
  1217. #endif /* STLSOFT_CF_CALLING_CONVENTION_OUTSIDE_BRACE_REQUIRED */
  1218. {
  1219. return stdcall_mem_fun_t<void, T>(func);
  1220. }
  1221. # else /* ? STLSOFT_CF_COMPILER_SUPPORTS_RETURN_VOID */
  1222. template< ss_typename_param_k T
  1223. >
  1224. #ifdef STLSOFT_CF_CALLING_CONVENTION_OUTSIDE_BRACE_REQUIRED
  1225. inline stdcall_mem_fun_void_t<T> mem_fun(void (T::*STLSOFT_STDCALL func)())
  1226. #else /* ? STLSOFT_CF_CALLING_CONVENTION_OUTSIDE_BRACE_REQUIRED */
  1227. inline stdcall_mem_fun_void_t<T> mem_fun(void (STLSOFT_STDCALL T::*func)())
  1228. #endif /* STLSOFT_CF_CALLING_CONVENTION_OUTSIDE_BRACE_REQUIRED */
  1229. {
  1230. return stdcall_mem_fun_void_t<T>(func);
  1231. }
  1232. template< ss_typename_param_k T
  1233. >
  1234. #ifdef STLSOFT_CF_CALLING_CONVENTION_OUTSIDE_BRACE_REQUIRED
  1235. inline stdcall_mem_fun_void_t<T> mem_fun_void(void (T::*STLSOFT_STDCALL func)())
  1236. #else /* ? STLSOFT_CF_CALLING_CONVENTION_OUTSIDE_BRACE_REQUIRED */
  1237. inline stdcall_mem_fun_void_t<T> mem_fun_void(void (STLSOFT_STDCALL T::*func)())
  1238. #endif /* STLSOFT_CF_CALLING_CONVENTION_OUTSIDE_BRACE_REQUIRED */
  1239. {
  1240. return stdcall_mem_fun_void_t<T>(func);
  1241. }
  1242. # endif /* STLSOFT_CF_COMPILER_SUPPORTS_RETURN_VOID */
  1243. #endif /* STLSOFT_CF_STDCALL_SUPPORTED */
  1244. /** \brief Creator function to adapt a pointer to a 0-parameter non-mutating
  1245. * (const) member function, for use with a pointer to the class.
  1246. *
  1247. * \ingroup group__library__functional
  1248. */
  1249. #ifdef STLSOFT_CF_STDCALL_SUPPORTED
  1250. template< ss_typename_param_k R
  1251. , ss_typename_param_k T
  1252. >
  1253. #ifdef STLSOFT_CF_CALLING_CONVENTION_OUTSIDE_BRACE_REQUIRED
  1254. inline stdcall_mem_fun_const_t<R, T> mem_fun(R (T::*STLSOFT_STDCALL func)() const)
  1255. #else /* ? STLSOFT_CF_CALLING_CONVENTION_OUTSIDE_BRACE_REQUIRED */
  1256. inline stdcall_mem_fun_const_t<R, T> mem_fun(R (STLSOFT_STDCALL T::*func)() const)
  1257. #endif /* STLSOFT_CF_CALLING_CONVENTION_OUTSIDE_BRACE_REQUIRED */
  1258. {
  1259. return stdcall_mem_fun_const_t<R, T>(func);
  1260. }
  1261. # if defined(STLSOFT_CF_COMPILER_SUPPORTS_RETURN_VOID)
  1262. /* We just provide mem_fun_void() that returns 'normal' type. */
  1263. template< ss_typename_param_k T
  1264. >
  1265. #ifdef STLSOFT_CF_CALLING_CONVENTION_OUTSIDE_BRACE_REQUIRED
  1266. inline stdcall_mem_fun_const_t<void, T> mem_fun_void(void (T::*STLSOFT_STDCALL func)() const)
  1267. #else /* ? STLSOFT_CF_CALLING_CONVENTION_OUTSIDE_BRACE_REQUIRED */
  1268. inline stdcall_mem_fun_const_t<void, T> mem_fun_void(void (STLSOFT_STDCALL T::*func)() const)
  1269. #endif /* STLSOFT_CF_CALLING_CONVENTION_OUTSIDE_BRACE_REQUIRED */
  1270. {
  1271. return stdcall_mem_fun_const_t<void, T>(func);
  1272. }
  1273. # else /* ? STLSOFT_CF_COMPILER_SUPPORTS_RETURN_VOID */
  1274. template< ss_typename_param_k T
  1275. >
  1276. #ifdef STLSOFT_CF_CALLING_CONVENTION_OUTSIDE_BRACE_REQUIRED
  1277. inline stdcall_mem_fun_const_void_t<T> mem_fun(void (T::*STLSOFT_STDCALL func)() const)
  1278. #else /* ? STLSOFT_CF_CALLING_CONVENTION_OUTSIDE_BRACE_REQUIRED */
  1279. inline stdcall_mem_fun_const_void_t<T> mem_fun(void (STLSOFT_STDCALL T::*func)() const)
  1280. #endif /* STLSOFT_CF_CALLING_CONVENTION_OUTSIDE_BRACE_REQUIRED */
  1281. {
  1282. return stdcall_mem_fun_const_void_t<T>(func);
  1283. }
  1284. template< ss_typename_param_k T
  1285. >
  1286. #ifdef STLSOFT_CF_CALLING_CONVENTION_OUTSIDE_BRACE_REQUIRED
  1287. inline stdcall_mem_fun_const_void_t<T> mem_fun_void(void (T::*STLSOFT_STDCALL func)() const)
  1288. #else /* ? STLSOFT_CF_CALLING_CONVENTION_OUTSIDE_BRACE_REQUIRED */
  1289. inline stdcall_mem_fun_const_void_t<T> mem_fun_void(void (STLSOFT_STDCALL T::*func)() const)
  1290. #endif /* STLSOFT_CF_CALLING_CONVENTION_OUTSIDE_BRACE_REQUIRED */
  1291. {
  1292. return stdcall_mem_fun_const_void_t<T>(func);
  1293. }
  1294. # endif /* STLSOFT_CF_COMPILER_SUPPORTS_RETURN_VOID */
  1295. #endif /* STLSOFT_CF_STDCALL_SUPPORTED */
  1296. #ifdef STLSOFT_CF_THISCALL_SUPPORTED
  1297. /** \brief Creator function to adapt a pointer to a 0-parameter mutating
  1298. * (non-const) member function, for use with a reference to the class.
  1299. *
  1300. * \ingroup group__library__functional
  1301. */
  1302. template< ss_typename_param_k R
  1303. , ss_typename_param_k T
  1304. >
  1305. inline thiscall_mem_fun_ref_t<R, T> mem_fun_ref(R (T::*func)())
  1306. {
  1307. return thiscall_mem_fun_ref_t<R, T>(func);
  1308. }
  1309. #if defined(STLSOFT_CF_COMPILER_SUPPORTS_RETURN_VOID)
  1310. /* We just provide mem_fun_ref_void() that returns 'normal' type. */
  1311. template< ss_typename_param_k T
  1312. >
  1313. inline thiscall_mem_fun_ref_t<void, T> mem_fun_ref_void(void (T::*func)())
  1314. {
  1315. return thiscall_mem_fun_ref_t<void, T>(func);
  1316. }
  1317. #else /* ? STLSOFT_CF_COMPILER_SUPPORTS_RETURN_VOID */
  1318. template< ss_typename_param_k T
  1319. >
  1320. inline thiscall_mem_fun_ref_void_t<T> mem_fun_ref(void (T::*func)())
  1321. {
  1322. return thiscall_mem_fun_ref_void_t<T>(func);
  1323. }
  1324. template< ss_typename_param_k T
  1325. >
  1326. inline thiscall_mem_fun_ref_void_t<T> mem_fun_ref_void(void (T::*func)())
  1327. {
  1328. return thiscall_mem_fun_ref_void_t<T>(func);
  1329. }
  1330. #endif /* STLSOFT_CF_COMPILER_SUPPORTS_RETURN_VOID */
  1331. /** \brief Creator function to adapt a pointer to a 0-parameter non-mutating
  1332. * (const) member function, for use with a reference to the class.
  1333. *
  1334. * \ingroup group__library__functional
  1335. */
  1336. template< ss_typename_param_k R
  1337. , ss_typename_param_k T
  1338. >
  1339. inline thiscall_mem_fun_ref_const_t<R, T> mem_fun_ref(R (T::*func)() const)
  1340. {
  1341. return thiscall_mem_fun_ref_const_t<R, T>(func);
  1342. }
  1343. #if defined(STLSOFT_CF_COMPILER_SUPPORTS_RETURN_VOID)
  1344. /* We just provide mem_fun_ref_void() that returns 'normal' type. */
  1345. template< ss_typename_param_k T
  1346. >
  1347. inline thiscall_mem_fun_ref_const_t<void, T> mem_fun_ref_void(void (T::*func)() const)
  1348. {
  1349. return thiscall_mem_fun_ref_const_t<void, T>(func);
  1350. }
  1351. #else /* ? STLSOFT_CF_COMPILER_SUPPORTS_RETURN_VOID */
  1352. template< ss_typename_param_k T
  1353. >
  1354. inline thiscall_mem_fun_ref_const_void_t<T> mem_fun_ref(void (T::*func)() const)
  1355. {
  1356. return thiscall_mem_fun_ref_const_void_t<T>(func);
  1357. }
  1358. template< ss_typename_param_k T
  1359. >
  1360. inline thiscall_mem_fun_ref_const_void_t<T> mem_fun_ref_void(void (T::*func)() const)
  1361. {
  1362. return thiscall_mem_fun_ref_const_void_t<T>(func);
  1363. }
  1364. # endif /* STLSOFT_CF_COMPILER_SUPPORTS_RETURN_VOID */
  1365. #endif /* STLSOFT_CF_THISCALL_SUPPORTED */
  1366. // cdecl
  1367. #ifdef STLSOFT_CF_CDECL_SUPPORTED
  1368. /** \brief Creator function to adapt a pointer to a 0-parameter mutating
  1369. * (non-const) member function, for use with a reference to the class.
  1370. *
  1371. * \ingroup group__library__functional
  1372. */
  1373. template< ss_typename_param_k R
  1374. , ss_typename_param_k T
  1375. >
  1376. #ifdef STLSOFT_CF_CALLING_CONVENTION_OUTSIDE_BRACE_REQUIRED
  1377. inline cdecl_mem_fun_ref_t<R, T> mem_fun_ref(R (T::*STLSOFT_CDECL func)())
  1378. #else /* ? STLSOFT_CF_CALLING_CONVENTION_OUTSIDE_BRACE_REQUIRED */
  1379. inline cdecl_mem_fun_ref_t<R, T> mem_fun_ref(R (STLSOFT_CDECL T::*func)())
  1380. #endif /* STLSOFT_CF_CALLING_CONVENTION_OUTSIDE_BRACE_REQUIRED */
  1381. {
  1382. return cdecl_mem_fun_ref_t<R, T>(func);
  1383. }
  1384. #if defined(STLSOFT_CF_COMPILER_SUPPORTS_RETURN_VOID)
  1385. /* We just provide mem_fun_ref_void() that returns 'normal' type. */
  1386. template< ss_typename_param_k T
  1387. >
  1388. #ifdef STLSOFT_CF_CALLING_CONVENTION_OUTSIDE_BRACE_REQUIRED
  1389. inline cdecl_mem_fun_ref_t<void, T> mem_fun_ref_void(void (T::*STLSOFT_CDECL func)())
  1390. #else /* ? STLSOFT_CF_CALLING_CONVENTION_OUTSIDE_BRACE_REQUIRED */
  1391. inline cdecl_mem_fun_ref_t<void, T> mem_fun_ref_void(void (STLSOFT_CDECL T::*func)())
  1392. #endif /* STLSOFT_CF_CALLING_CONVENTION_OUTSIDE_BRACE_REQUIRED */
  1393. {
  1394. return cdecl_mem_fun_ref_t<void, T>(func);
  1395. }
  1396. #else /* ? STLSOFT_CF_COMPILER_SUPPORTS_RETURN_VOID */
  1397. template< ss_typename_param_k T
  1398. >
  1399. #ifdef STLSOFT_CF_CALLING_CONVENTION_OUTSIDE_BRACE_REQUIRED
  1400. inline cdecl_mem_fun_ref_void_t<T> mem_fun_ref(void (T::*STLSOFT_CDECL func)())
  1401. #else /* ? STLSOFT_CF_CALLING_CONVENTION_OUTSIDE_BRACE_REQUIRED */
  1402. inline cdecl_mem_fun_ref_void_t<T> mem_fun_ref(void (STLSOFT_CDECL T::*func)())
  1403. #endif /* STLSOFT_CF_CALLING_CONVENTION_OUTSIDE_BRACE_REQUIRED */
  1404. {
  1405. return cdecl_mem_fun_ref_void_t<T>(func);
  1406. }
  1407. template< ss_typename_param_k T
  1408. >
  1409. #ifdef STLSOFT_CF_CALLING_CONVENTION_OUTSIDE_BRACE_REQUIRED
  1410. inline cdecl_mem_fun_ref_void_t<T> mem_fun_ref_void(void (T::*STLSOFT_CDECL func)())
  1411. #else /* ? STLSOFT_CF_CALLING_CONVENTION_OUTSIDE_BRACE_REQUIRED */
  1412. inline cdecl_mem_fun_ref_void_t<T> mem_fun_ref_void(void (STLSOFT_CDECL T::*func)())
  1413. #endif /* STLSOFT_CF_CALLING_CONVENTION_OUTSIDE_BRACE_REQUIRED */
  1414. {
  1415. return cdecl_mem_fun_ref_void_t<T>(func);
  1416. }
  1417. #endif /* STLSOFT_CF_COMPILER_SUPPORTS_RETURN_VOID */
  1418. /** \brief Creator function to adapt a pointer to a 0-parameter non-mutating
  1419. * (const) member function, for use with a reference to the class.
  1420. *
  1421. * \ingroup group__library__functional
  1422. */
  1423. template< ss_typename_param_k R
  1424. , ss_typename_param_k T
  1425. >
  1426. #ifdef STLSOFT_CF_CALLING_CONVENTION_OUTSIDE_BRACE_REQUIRED
  1427. inline cdecl_mem_fun_ref_const_t<R, T> mem_fun_ref(R (T::*STLSOFT_CDECL func)() const)
  1428. #else /* ? STLSOFT_CF_CALLING_CONVENTION_OUTSIDE_BRACE_REQUIRED */
  1429. inline cdecl_mem_fun_ref_const_t<R, T> mem_fun_ref(R (STLSOFT_CDECL T::*func)() const)
  1430. #endif /* STLSOFT_CF_CALLING_CONVENTION_OUTSIDE_BRACE_REQUIRED */
  1431. {
  1432. return cdecl_mem_fun_ref_const_t<R, T>(func);
  1433. }
  1434. #if defined(STLSOFT_CF_COMPILER_SUPPORTS_RETURN_VOID)
  1435. /* We just provide mem_fun_ref_void() that returns 'normal' type. */
  1436. template< ss_typename_param_k T
  1437. >
  1438. #ifdef STLSOFT_CF_CALLING_CONVENTION_OUTSIDE_BRACE_REQUIRED
  1439. inline cdecl_mem_fun_ref_const_t<void, T> mem_fun_ref_void(void (T::*STLSOFT_CDECL func)() const)
  1440. #else /* ? STLSOFT_CF_CALLING_CONVENTION_OUTSIDE_BRACE_REQUIRED */
  1441. inline cdecl_mem_fun_ref_const_t<void, T> mem_fun_ref_void(void (STLSOFT_CDECL T::*func)() const)
  1442. #endif /* STLSOFT_CF_CALLING_CONVENTION_OUTSIDE_BRACE_REQUIRED */
  1443. {
  1444. return cdecl_mem_fun_ref_const_t<void, T>(func);
  1445. }
  1446. #else /* ? STLSOFT_CF_COMPILER_SUPPORTS_RETURN_VOID */
  1447. template< ss_typename_param_k T
  1448. >
  1449. #ifdef STLSOFT_CF_CALLING_CONVENTION_OUTSIDE_BRACE_REQUIRED
  1450. inline cdecl_mem_fun_ref_const_void_t<T> mem_fun_ref(void (T::*STLSOFT_CDECL func)() const)
  1451. #else /* ? STLSOFT_CF_CALLING_CONVENTION_OUTSIDE_BRACE_REQUIRED */
  1452. inline cdecl_mem_fun_ref_const_void_t<T> mem_fun_ref(void (STLSOFT_CDECL T::*func)() const)
  1453. #endif /* STLSOFT_CF_CALLING_CONVENTION_OUTSIDE_BRACE_REQUIRED */
  1454. {
  1455. return cdecl_mem_fun_ref_const_void_t<T>(func);
  1456. }
  1457. template< ss_typename_param_k T
  1458. >
  1459. #ifdef STLSOFT_CF_CALLING_CONVENTION_OUTSIDE_BRACE_REQUIRED
  1460. inline cdecl_mem_fun_ref_const_void_t<T> mem_fun_ref_void(void (T::*STLSOFT_CDECL func)() const)
  1461. #else /* ? STLSOFT_CF_CALLING_CONVENTION_OUTSIDE_BRACE_REQUIRED */
  1462. inline cdecl_mem_fun_ref_const_void_t<T> mem_fun_ref_void(void (STLSOFT_CDECL T::*func)() const)
  1463. #endif /* STLSOFT_CF_CALLING_CONVENTION_OUTSIDE_BRACE_REQUIRED */
  1464. {
  1465. return cdecl_mem_fun_ref_const_void_t<T>(func);
  1466. }
  1467. # endif /* STLSOFT_CF_COMPILER_SUPPORTS_RETURN_VOID */
  1468. #endif /* STLSOFT_CF_CDECL_SUPPORTED */
  1469. // fastcall
  1470. #ifdef STLSOFT_CF_FASTCALL_SUPPORTED
  1471. /** \brief Creator function to adapt a pointer to a 0-parameter mutating
  1472. * (non-const) member function, for use with a reference to the class.
  1473. *
  1474. * \ingroup group__library__functional
  1475. */
  1476. template< ss_typename_param_k R
  1477. , ss_typename_param_k T
  1478. >
  1479. #ifdef STLSOFT_CF_CALLING_CONVENTION_OUTSIDE_BRACE_REQUIRED
  1480. inline fastcall_mem_fun_ref_t<R, T> mem_fun_ref(R (T::*STLSOFT_FASTCALL func)())
  1481. #else /* ? STLSOFT_CF_CALLING_CONVENTION_OUTSIDE_BRACE_REQUIRED */
  1482. inline fastcall_mem_fun_ref_t<R, T> mem_fun_ref(R (STLSOFT_FASTCALL T::*func)())
  1483. #endif /* STLSOFT_CF_CALLING_CONVENTION_OUTSIDE_BRACE_REQUIRED */
  1484. {
  1485. return fastcall_mem_fun_ref_t<R, T>(func);
  1486. }
  1487. # if defined(STLSOFT_CF_COMPILER_SUPPORTS_RETURN_VOID)
  1488. /* We just provide mem_fun_ref_void() that returns 'normal' type. */
  1489. template< ss_typename_param_k T
  1490. >
  1491. #ifdef STLSOFT_CF_CALLING_CONVENTION_OUTSIDE_BRACE_REQUIRED
  1492. inline fastcall_mem_fun_ref_t<void, T> mem_fun_ref_void(void (T::*STLSOFT_FASTCALL func)())
  1493. #else /* ? STLSOFT_CF_CALLING_CONVENTION_OUTSIDE_BRACE_REQUIRED */
  1494. inline fastcall_mem_fun_ref_t<void, T> mem_fun_ref_void(void (STLSOFT_FASTCALL T::*func)())
  1495. #endif /* STLSOFT_CF_CALLING_CONVENTION_OUTSIDE_BRACE_REQUIRED */
  1496. {
  1497. return fastcall_mem_fun_ref_t<void, T>(func);
  1498. }
  1499. # else /* ? STLSOFT_CF_COMPILER_SUPPORTS_RETURN_VOID */
  1500. template< ss_typename_param_k T
  1501. >
  1502. #ifdef STLSOFT_CF_CALLING_CONVENTION_OUTSIDE_BRACE_REQUIRED
  1503. inline fastcall_mem_fun_ref_void_t<T> mem_fun_ref(void (T::*STLSOFT_FASTCALL func)())
  1504. #else /* ? STLSOFT_CF_CALLING_CONVENTION_OUTSIDE_BRACE_REQUIRED */
  1505. inline fastcall_mem_fun_ref_void_t<T> mem_fun_ref(void (STLSOFT_FASTCALL T::*func)())
  1506. #endif /* STLSOFT_CF_CALLING_CONVENTION_OUTSIDE_BRACE_REQUIRED */
  1507. {
  1508. return fastcall_mem_fun_ref_void_t<T>(func);
  1509. }
  1510. template< ss_typename_param_k T
  1511. >
  1512. #ifdef STLSOFT_CF_CALLING_CONVENTION_OUTSIDE_BRACE_REQUIRED
  1513. inline fastcall_mem_fun_ref_void_t<T> mem_fun_ref_void(void (T::*STLSOFT_FASTCALL func)())
  1514. #else /* ? STLSOFT_CF_CALLING_CONVENTION_OUTSIDE_BRACE_REQUIRED */
  1515. inline fastcall_mem_fun_ref_void_t<T> mem_fun_ref_void(void (STLSOFT_FASTCALL T::*func)())
  1516. #endif /* STLSOFT_CF_CALLING_CONVENTION_OUTSIDE_BRACE_REQUIRED */
  1517. {
  1518. return fastcall_mem_fun_ref_void_t<T>(func);
  1519. }
  1520. # endif /* STLSOFT_CF_COMPILER_SUPPORTS_RETURN_VOID */
  1521. #endif /* STLSOFT_CF_FASTCALL_SUPPORTED */
  1522. #ifdef STLSOFT_CF_FASTCALL_SUPPORTED
  1523. /** \brief Creator function to adapt a pointer to a 0-parameter non-mutating
  1524. * (const) member function, for use with a reference to the class.
  1525. *
  1526. * \ingroup group__library__functional
  1527. */
  1528. template< ss_typename_param_k R
  1529. , ss_typename_param_k T
  1530. >
  1531. #ifdef STLSOFT_CF_CALLING_CONVENTION_OUTSIDE_BRACE_REQUIRED
  1532. inline fastcall_mem_fun_ref_const_t<R, T> mem_fun_ref(R (T::*STLSOFT_FASTCALL func)() const)
  1533. #else /* ? STLSOFT_CF_CALLING_CONVENTION_OUTSIDE_BRACE_REQUIRED */
  1534. inline fastcall_mem_fun_ref_const_t<R, T> mem_fun_ref(R (STLSOFT_FASTCALL T::*func)() const)
  1535. #endif /* STLSOFT_CF_CALLING_CONVENTION_OUTSIDE_BRACE_REQUIRED */
  1536. {
  1537. return fastcall_mem_fun_ref_const_t<R, T>(func);
  1538. }
  1539. # if defined(STLSOFT_CF_COMPILER_SUPPORTS_RETURN_VOID)
  1540. /* We just provide mem_fun_ref_void() that returns 'normal' type. */
  1541. template< ss_typename_param_k T
  1542. >
  1543. #ifdef STLSOFT_CF_CALLING_CONVENTION_OUTSIDE_BRACE_REQUIRED
  1544. inline fastcall_mem_fun_ref_const_t<void, T> mem_fun_ref_void(void (T::*STLSOFT_FASTCALL func)() const)
  1545. #else /* ? STLSOFT_CF_CALLING_CONVENTION_OUTSIDE_BRACE_REQUIRED */
  1546. inline fastcall_mem_fun_ref_const_t<void, T> mem_fun_ref_void(void (STLSOFT_FASTCALL T::*func)() const)
  1547. #endif /* STLSOFT_CF_CALLING_CONVENTION_OUTSIDE_BRACE_REQUIRED */
  1548. {
  1549. return fastcall_mem_fun_ref_const_t<void, T>(func);
  1550. }
  1551. # else /* ? STLSOFT_CF_COMPILER_SUPPORTS_RETURN_VOID */
  1552. template< ss_typename_param_k T
  1553. >
  1554. #ifdef STLSOFT_CF_CALLING_CONVENTION_OUTSIDE_BRACE_REQUIRED
  1555. inline fastcall_mem_fun_ref_const_void_t<T> mem_fun_ref(void (T::*STLSOFT_FASTCALL func)() const)
  1556. #else /* ? STLSOFT_CF_CALLING_CONVENTION_OUTSIDE_BRACE_REQUIRED */
  1557. inline fastcall_mem_fun_ref_const_void_t<T> mem_fun_ref(void (STLSOFT_FASTCALL T::*func)() const)
  1558. #endif /* STLSOFT_CF_CALLING_CONVENTION_OUTSIDE_BRACE_REQUIRED */
  1559. {
  1560. return fastcall_mem_fun_ref_const_void_t<T>(func);
  1561. }
  1562. template< ss_typename_param_k T
  1563. >
  1564. #ifdef STLSOFT_CF_CALLING_CONVENTION_OUTSIDE_BRACE_REQUIRED
  1565. inline fastcall_mem_fun_ref_const_void_t<T> mem_fun_ref_void(void (T::*STLSOFT_FASTCALL func)() const)
  1566. #else /* ? STLSOFT_CF_CALLING_CONVENTION_OUTSIDE_BRACE_REQUIRED */
  1567. inline fastcall_mem_fun_ref_const_void_t<T> mem_fun_ref_void(void (STLSOFT_FASTCALL T::*func)() const)
  1568. #endif /* STLSOFT_CF_CALLING_CONVENTION_OUTSIDE_BRACE_REQUIRED */
  1569. {
  1570. return fastcall_mem_fun_ref_const_void_t<T>(func);
  1571. }
  1572. # endif /* STLSOFT_CF_COMPILER_SUPPORTS_RETURN_VOID */
  1573. #endif /* STLSOFT_CF_FASTCALL_SUPPORTED */
  1574. // stdcall
  1575. #ifdef STLSOFT_CF_STDCALL_SUPPORTED
  1576. /** \brief Creator function to adapt a pointer to a 0-parameter mutating
  1577. * (non-const) member function, for use with a reference to the class.
  1578. *
  1579. * \ingroup group__library__functional
  1580. */
  1581. template< ss_typename_param_k R
  1582. , ss_typename_param_k T
  1583. >
  1584. #ifdef STLSOFT_CF_CALLING_CONVENTION_OUTSIDE_BRACE_REQUIRED
  1585. inline stdcall_mem_fun_ref_t<R, T> mem_fun_ref(R (T::*STLSOFT_STDCALL func)())
  1586. #else /* ? STLSOFT_CF_CALLING_CONVENTION_OUTSIDE_BRACE_REQUIRED */
  1587. inline stdcall_mem_fun_ref_t<R, T> mem_fun_ref(R (STLSOFT_STDCALL T::*func)())
  1588. #endif /* STLSOFT_CF_CALLING_CONVENTION_OUTSIDE_BRACE_REQUIRED */
  1589. {
  1590. return stdcall_mem_fun_ref_t<R, T>(func);
  1591. }
  1592. # if defined(STLSOFT_CF_COMPILER_SUPPORTS_RETURN_VOID)
  1593. /* We just provide mem_fun_ref_void() that returns 'normal' type. */
  1594. template< ss_typename_param_k T
  1595. >
  1596. #ifdef STLSOFT_CF_CALLING_CONVENTION_OUTSIDE_BRACE_REQUIRED
  1597. inline stdcall_mem_fun_ref_t<void, T> mem_fun_ref_void(void (T::*STLSOFT_STDCALL func)())
  1598. #else /* ? STLSOFT_CF_CALLING_CONVENTION_OUTSIDE_BRACE_REQUIRED */
  1599. inline stdcall_mem_fun_ref_t<void, T> mem_fun_ref_void(void (STLSOFT_STDCALL T::*func)())
  1600. #endif /* STLSOFT_CF_CALLING_CONVENTION_OUTSIDE_BRACE_REQUIRED */
  1601. {
  1602. return stdcall_mem_fun_ref_t<void, T>(func);
  1603. }
  1604. # else /* ? STLSOFT_CF_COMPILER_SUPPORTS_RETURN_VOID */
  1605. template< ss_typename_param_k T
  1606. >
  1607. #ifdef STLSOFT_CF_CALLING_CONVENTION_OUTSIDE_BRACE_REQUIRED
  1608. inline stdcall_mem_fun_ref_void_t<T> mem_fun_ref(void (T::*STLSOFT_STDCALL func)())
  1609. #else /* ? STLSOFT_CF_CALLING_CONVENTION_OUTSIDE_BRACE_REQUIRED */
  1610. inline stdcall_mem_fun_ref_void_t<T> mem_fun_ref(void (STLSOFT_STDCALL T::*func)())
  1611. #endif /* STLSOFT_CF_CALLING_CONVENTION_OUTSIDE_BRACE_REQUIRED */
  1612. {
  1613. return stdcall_mem_fun_ref_void_t<T>(func);
  1614. }
  1615. template< ss_typename_param_k T
  1616. >
  1617. #ifdef STLSOFT_CF_CALLING_CONVENTION_OUTSIDE_BRACE_REQUIRED
  1618. inline stdcall_mem_fun_ref_void_t<T> mem_fun_ref_void(void (T::*STLSOFT_STDCALL func)())
  1619. #else /* ? STLSOFT_CF_CALLING_CONVENTION_OUTSIDE_BRACE_REQUIRED */
  1620. inline stdcall_mem_fun_ref_void_t<T> mem_fun_ref_void(void (STLSOFT_STDCALL T::*func)())
  1621. #endif /* STLSOFT_CF_CALLING_CONVENTION_OUTSIDE_BRACE_REQUIRED */
  1622. {
  1623. return stdcall_mem_fun_ref_void_t<T>(func);
  1624. }
  1625. # endif /* STLSOFT_CF_COMPILER_SUPPORTS_RETURN_VOID */
  1626. #endif /* STLSOFT_CF_STDCALL_SUPPORTED */
  1627. #ifdef STLSOFT_CF_STDCALL_SUPPORTED
  1628. /** \brief Creator function to adapt a pointer to a 0-parameter non-mutating
  1629. * (const) member function, for use with a reference to the class.
  1630. *
  1631. * \ingroup group__library__functional
  1632. */
  1633. template< ss_typename_param_k R
  1634. , ss_typename_param_k T
  1635. >
  1636. #ifdef STLSOFT_CF_CALLING_CONVENTION_OUTSIDE_BRACE_REQUIRED
  1637. inline stdcall_mem_fun_ref_const_t<R, T> mem_fun_ref(R (T::*STLSOFT_STDCALL func)() const)
  1638. #else /* ? STLSOFT_CF_CALLING_CONVENTION_OUTSIDE_BRACE_REQUIRED */
  1639. inline stdcall_mem_fun_ref_const_t<R, T> mem_fun_ref(R (STLSOFT_STDCALL T::*func)() const)
  1640. #endif /* STLSOFT_CF_CALLING_CONVENTION_OUTSIDE_BRACE_REQUIRED */
  1641. {
  1642. return stdcall_mem_fun_ref_const_t<R, T>(func);
  1643. }
  1644. # if defined(STLSOFT_CF_COMPILER_SUPPORTS_RETURN_VOID)
  1645. /* We just provide mem_fun_ref_void() that returns 'normal' type. */
  1646. template< ss_typename_param_k T
  1647. >
  1648. #ifdef STLSOFT_CF_CALLING_CONVENTION_OUTSIDE_BRACE_REQUIRED
  1649. inline stdcall_mem_fun_ref_const_t<void, T> mem_fun_ref_void(void (T::*STLSOFT_STDCALL func)() const)
  1650. #else /* ? STLSOFT_CF_CALLING_CONVENTION_OUTSIDE_BRACE_REQUIRED */
  1651. inline stdcall_mem_fun_ref_const_t<void, T> mem_fun_ref_void(void (STLSOFT_STDCALL T::*func)() const)
  1652. #endif /* STLSOFT_CF_CALLING_CONVENTION_OUTSIDE_BRACE_REQUIRED */
  1653. {
  1654. return stdcall_mem_fun_ref_const_t<void, T>(func);
  1655. }
  1656. # else /* ? STLSOFT_CF_COMPILER_SUPPORTS_RETURN_VOID */
  1657. template< ss_typename_param_k T
  1658. >
  1659. #ifdef STLSOFT_CF_CALLING_CONVENTION_OUTSIDE_BRACE_REQUIRED
  1660. inline stdcall_mem_fun_ref_const_void_t<T> mem_fun_ref(void (T::*STLSOFT_STDCALL func)() const)
  1661. #else /* ? STLSOFT_CF_CALLING_CONVENTION_OUTSIDE_BRACE_REQUIRED */
  1662. inline stdcall_mem_fun_ref_const_void_t<T> mem_fun_ref(void (STLSOFT_STDCALL T::*func)() const)
  1663. #endif /* STLSOFT_CF_CALLING_CONVENTION_OUTSIDE_BRACE_REQUIRED */
  1664. {
  1665. return stdcall_mem_fun_ref_const_void_t<T>(func);
  1666. }
  1667. template< ss_typename_param_k T
  1668. >
  1669. #ifdef STLSOFT_CF_CALLING_CONVENTION_OUTSIDE_BRACE_REQUIRED
  1670. inline stdcall_mem_fun_ref_const_void_t<T> mem_fun_ref_void(void (T::*STLSOFT_STDCALL func)() const)
  1671. #else /* ? STLSOFT_CF_CALLING_CONVENTION_OUTSIDE_BRACE_REQUIRED */
  1672. inline stdcall_mem_fun_ref_const_void_t<T> mem_fun_ref_void(void (STLSOFT_STDCALL T::*func)() const)
  1673. #endif /* STLSOFT_CF_CALLING_CONVENTION_OUTSIDE_BRACE_REQUIRED */
  1674. {
  1675. return stdcall_mem_fun_ref_const_void_t<T>(func);
  1676. }
  1677. # endif /* STLSOFT_CF_COMPILER_SUPPORTS_RETURN_VOID */
  1678. #endif /* STLSOFT_CF_STDCALL_SUPPORTED */
  1679. /* ////////////////////////////////////////////////////////////////////// */
  1680. #ifndef _STLSOFT_NO_NAMESPACE
  1681. } // namespace stlsoft
  1682. #endif /* _STLSOFT_NO_NAMESPACE */
  1683. /* ////////////////////////////////////////////////////////////////////// */
  1684. #endif /* !STLSOFT_INCL_STLSOFT_FUNCTIONAL_HPP_METHOD_ADAPTORS */
  1685. /* ///////////////////////////// end of file //////////////////////////// */