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

This commit is contained in:
Davis@potato-xp.localnet 2011-11-03 00:06:31 -04:00
parent cb7cfec182
commit 6cbbe937dc
1 changed files with 8 additions and 2 deletions

View File

@ -79,16 +79,22 @@ namespace dlib
template <typename T>
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.
template <typename T, typename U = void >
template <typename T, unsigned long U = work_around_visual_studio_bug<T>::U >
struct has_reject_labeling
{
static const bool value = false;
};
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;
};