Commit d7ecc1fa authored by Davis King's avatar Davis King

Made the member_function_pointer more robust to the amount of memory in its stack

based block of memory not being big enough.  We should now be guaranteed that it
will either fit or it won't compile.

--HG--
extra : convert_revision : svn%3Afdd8eb12-d10e-0410-9acb-85c331704f74/trunk%402630
parent 5faacf97
......@@ -25,9 +25,9 @@ namespace dlib
//----------- kernels ---------------
// kernel_1a
typedef member_function_pointer_kernel_1<PARAM1,PARAM2,PARAM3,PARAM4>
typedef mfpk1<PARAM1,PARAM2,PARAM3,PARAM4>
kernel_1a;
typedef member_function_pointer_kernel_c<kernel_1a>
typedef mfpkc<kernel_1a>
kernel_1a_c;
......
......@@ -248,7 +248,7 @@ namespace dlib
void (T::*cb)(PARAM1)const
);
operator bool (
operator some_undefined_pointer_type (
) const;
bool operator! (
......@@ -315,7 +315,7 @@ namespace dlib
void (T::*cb)(PARAM1,PARAM2)const
);
operator bool (
operator some_undefined_pointer_type (
) const;
bool operator! (
......@@ -384,7 +384,7 @@ namespace dlib
void (T::*cb)(PARAM1,PARAM2,PARAM3)const
);
operator bool (
operator some_undefined_pointer_type (
) const;
bool operator! (
......@@ -455,7 +455,7 @@ namespace dlib
void (T::*cb)(PARAM1,PARAM2,PARAM3,PARAM4)const
);
operator bool (
operator some_undefined_pointer_type (
) const;
bool operator! (
......
......@@ -17,14 +17,14 @@ namespace dlib
typename PARAM3 = typename mfpb::param3_type,
typename PARAM4 = typename mfpb::param4_type
>
class member_function_pointer_kernel_c;
class mfpkc;
// ----------------------------------------------------------------------------------------
template <
typename mfpb
>
class member_function_pointer_kernel_c<mfpb,void,void,void,void> :
class mfpkc<mfpb,void,void,void,void> :
public mfpb
{
public:
......@@ -88,7 +88,7 @@ namespace dlib
typename mfpb,
typename PARAM1
>
class member_function_pointer_kernel_c<mfpb,PARAM1,void,void,void> :
class mfpkc<mfpb,PARAM1,void,void,void> :
public mfpb
{
public:
......@@ -154,7 +154,7 @@ namespace dlib
typename PARAM1,
typename PARAM2
>
class member_function_pointer_kernel_c<mfpb,PARAM1,PARAM2,void,void> :
class mfpkc<mfpb,PARAM1,PARAM2,void,void> :
public mfpb
{
public:
......@@ -222,7 +222,7 @@ namespace dlib
typename PARAM2,
typename PARAM3
>
class member_function_pointer_kernel_c<mfpb,PARAM1,PARAM2,PARAM3,void> :
class mfpkc<mfpb,PARAM1,PARAM2,PARAM3,void> :
public mfpb
{
public:
......@@ -292,7 +292,7 @@ namespace dlib
typename PARAM3,
typename PARAM4
>
class member_function_pointer_kernel_c :
class mfpkc :
public mfpb
{
public:
......
......@@ -122,11 +122,11 @@ namespace
mfp<int,int,int> a3, b3;
mfp<int,int,int,int> a4, b4;
member_function_pointer_kernel_c<mfp<> > a0c, b0c;
member_function_pointer_kernel_c<mfp<int> > a1c, b1c;
member_function_pointer_kernel_c<mfp<int,int> > a2c, b2c;
member_function_pointer_kernel_c<mfp<int,int,int> > a3c, b3c;
member_function_pointer_kernel_c<mfp<int,int,int,int> > a4c, b4c;
mfpkc<mfp<> > a0c, b0c;
mfpkc<mfp<int> > a1c, b1c;
mfpkc<mfp<int,int> > a2c, b2c;
mfpkc<mfp<int,int,int> > a3c, b3c;
mfpkc<mfp<int,int,int,int> > a4c, b4c;
DLIB_CASSERT(a0c == b0c, "");
DLIB_CASSERT(a1c == b1c, "");
......@@ -543,8 +543,8 @@ namespace
void perform_test (
)
{
member_function_pointer_kernel_test<member_function_pointer_kernel_1,mfp_test_helper>();
member_function_pointer_kernel_test<member_function_pointer_kernel_1,mfp_test_helper_const>();
member_function_pointer_kernel_test<mfpk1,mfp_test_helper>();
member_function_pointer_kernel_test<mfpk1,mfp_test_helper_const>();
}
} a;
......
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