Boost logo

Boost Users :

From: Rob Caldecott (robert.caldecott_at_[hidden])
Date: 2007-01-09 03:59:39


I am trying to test a template function that takes two template parameters,
and, because of the "comma in macros" compiler issue, I have hit a brick wall.
For example:

  template<typename T1, typename T2>
  int func(const T1& t1, const T2& t2)
  {
  ...
  }

  BOOST_CHECK_EQUAL(func<std::string, int>("Test", 1234), 1234);

When compiling BOOST_CHECK_EQUAL above, I get an error due to the comma between
std::string and int. As this is a function, I cannot use typedef, and trying to
#define a workaround also fails (I am using VS2005).

Any ideas how I can test template functions with more than one template
parameter?

Thanks in advance.


Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net