Skip to content

Commit

Permalink
add debug messages for comparison of any
Browse files Browse the repository at this point in the history
  • Loading branch information
karlnapf committed Jan 8, 2018
1 parent 1dff7cf commit 8dec3e0
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/shogun/lib/any.h
Expand Up @@ -39,6 +39,7 @@
#include <string>
#include <string.h>
#include <typeinfo>
#include <shogun/io/SGIO.h>
#ifdef HAVE_CXA_DEMANGLE
#include <cxxabi.h>
#endif
Expand Down Expand Up @@ -139,20 +140,23 @@ namespace shogun
template <class T>
auto compare_impl(general, T& lhs, T& rhs) -> decltype(lhs == rhs)
{
SG_SDEBUG("Comparing using lhs==rhs.\n");
return lhs == rhs;
}

template <class T>
auto compare_impl(more_important, T& lhs, T& rhs)
-> decltype(lhs.equals(rhs))
{
SG_SDEBUG("Comparing using lhs.equals(rhs).\n");
return lhs.equals(rhs);
}

template <class T>
auto compare_impl(maybe_most_important, T* lhs, T* rhs)
-> decltype(lhs->equals(rhs))
{
SG_SDEBUG("Comparing using lhs->equals(rhs).\n");
if (lhs && rhs)
return lhs->equals(rhs);
else if (!lhs && ! rhs)
Expand Down

0 comments on commit 8dec3e0

Please sign in to comment.