Boost logo

Boost :

From: Stefan Slapeta (stefan_nospam__at_[hidden])
Date: 2004-03-25 09:39:12


BOOST_CHECK_EQUAL c style strings does not work on Intel if strings are passed
in a buffer:

        char val[10];

        strcpy(val, "test");

        BOOST_CHECK_EQUAL("test", "test"); // ok
        BOOST_CHECK_EQUAL(val, "test"); // fails always

The reason:

void f(const char *, const char *)
{
}

template <typename T1, typename T2>
void f(const T1&, const T2&)
{
}

int main()
{
  char val[100];
  strcpy(val, "test");

  // Here is the difference to VC 7.1:
  // VC calls f(const char *, const char*)
  // Intel calls the function template
  f(val, "test");
}

I would guess that Intel works correctly here as f(const char*, const char*)
is no exact match for the arguments char[10], const char*.

Any suggestions?

Stefan

***********************************

Stefan Slapeta
Wien/Vienna, Austria

http://www.slapeta.com


Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk