Changed a little to work around a bug in visual studio 2005

parent cb7cfec1
...@@ -79,16 +79,22 @@ namespace dlib ...@@ -79,16 +79,22 @@ namespace dlib
template <typename T> template <typename T>
two_bytes has_reject_labeling_helper(int) { return two_bytes();} two_bytes has_reject_labeling_helper(int) { return two_bytes();}
template <typename T>
struct work_around_visual_studio_bug
{
const static unsigned long U = sizeof(has_reject_labeling_helper<T>('a'));
};
// This is a template to tell you if a feature_extractor has a reject_labeling function or not. // This is a template to tell you if a feature_extractor has a reject_labeling function or not.
template <typename T, typename U = void > template <typename T, unsigned long U = work_around_visual_studio_bug<T>::U >
struct has_reject_labeling struct has_reject_labeling
{ {
static const bool value = false; static const bool value = false;
}; };
template <typename T> template <typename T>
struct has_reject_labeling <T,typename dlib::enable_if_c<sizeof(dlib::impl::has_reject_labeling_helper<T>('a')) == 1 >::type > struct has_reject_labeling <T,1>
{ {
static const bool value = true; static const bool value = true;
}; };
......
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