Boost logo

Boost Users :

From: Stjepan Rajko (stipe_at_[hidden])
Date: 2007-11-08 19:10:03


On Nov 8, 2007 4:20 PM, MOSS Sebastian <Sebastian.MOSS_at_[hidden]> wrote:
> Hi,
>
> I'm having trouble with the following design with vs 7.1 and wondering if anyone could offer a workaround.
>
> Particularly it seems that the ".template operator" syntax isn't liked. (This works on gcc 4.0.3). Removing the
> 'template' keyword from the bind arguments gives an error novel.
>

I was having a similar issue with msvc8. Not sure what the underlying
problem is but I ended up just using the template keyword
conditionally for non-MSVC compilers. I.e., something like

#include <boost/config.hpp>
...

boost::bind(&bound::
#ifndef BOOST_MSVC
  template
#endif
    operator&<T>,
    instance,
    obj);

It would probably be cleaner to define something like
TEMPLATE_OPERATOR to template for non-msvc and to nothing for msvc,
and use that instead. Maybe something like that is already defined
somewhere.

HTH,

Stjepan


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