Commit 381e450b authored by Davis King's avatar Davis King

Added the ability to bind function objects as well as normal C style functions

and member function pointers.

--HG--
extra : convert_revision : svn%3Afdd8eb12-d10e-0410-9acb-85c331704f74/trunk%402679
parent 2d3e8dd3
...@@ -121,6 +121,19 @@ namespace dlib ...@@ -121,6 +121,19 @@ namespace dlib
// ---------------------- // ----------------------
template <typename F, typename A1 >
void set (
F& function_object,
A1& arg1
);
/*!
requires
- function_object(arg1) is a valid expression
ensures
- #is_set() == true
- calls to this->operator() will call function_object(arg1)
!*/
template < typename T, typename T1, typename A1 > template < typename T, typename T1, typename A1 >
void set ( void set (
T& object, T& object,
...@@ -163,6 +176,19 @@ namespace dlib ...@@ -163,6 +176,19 @@ namespace dlib
!*/ !*/
// ---------------------- // ----------------------
template <typename F, typename A1, typename A2 >
void set (
F& function_object,
A1& arg1,
A2& arg2
);
/*!
requires
- function_object(arg1,arg2) is a valid expression
ensures
- #is_set() == true
- calls to this->operator() will call function_object(arg1,arg2)
!*/
template < typename T, typename T1, typename A1 template < typename T, typename T1, typename A1
typename T2, typename A2> typename T2, typename A2>
...@@ -213,6 +239,21 @@ namespace dlib ...@@ -213,6 +239,21 @@ namespace dlib
// ---------------------- // ----------------------
template <typename F, typename A1, typename A2, typename A3 >
void set (
F& function_object,
A1& arg1,
A2& arg2,
A3& arg3
);
/*!
requires
- function_object(arg1,arg2,arg3) is a valid expression
ensures
- #is_set() == true
- calls to this->operator() will call function_object(arg1,arg2,arg3)
!*/
template < typename T, typename T1, typename A1 template < typename T, typename T1, typename A1
typename T2, typename A2, typename T2, typename A2,
typename T3, typename A3> typename T3, typename A3>
...@@ -268,6 +309,22 @@ namespace dlib ...@@ -268,6 +309,22 @@ namespace dlib
// ---------------------- // ----------------------
template <typename F, typename A1, typename A2, typename A3, typename A4>
void set (
F& function_object,
A1& arg1,
A2& arg2,
A3& arg3,
A4& arg4
);
/*!
requires
- function_object(arg1,arg2,arg3,arg4) is a valid expression
ensures
- #is_set() == true
- calls to this->operator() will call function_object(arg1,arg2,arg3,arg4)
!*/
template < typename T, typename T1, typename A1 template < typename T, typename T1, typename A1
typename T2, typename A2, typename T2, typename A2,
typename T3, typename A3, typename T3, typename A3,
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment