[sigc] libsigc++ & Forte: template operator()



On Thu, 2004-03-18 at 01:58, Murray Cumming wrote:
> On Thu, 2004-03-18 at 00:16, Martin Schulze wrote:
> > you could try to compile current cvs.
> 
> In case you don't see the same thing yourself already:
> 
> The build is now broken with regular gcc++ 3.2.2 (RedHat 9)

The __GCC__ macro does not seem be be defined. I'm trying to write a
configure-time test (see the attached code) but it fails on my SUN Forte
(5.3) compiler with or without the "template" word on line 31. 

Martin, is this an appropriate test?

Damien, does it build for you? Does it build without the template word
on line 31?

-- 
Murray Cumming
www.murrayc.com
murrayc murrayc com
#include <iostream>
   
template <class T1>
class SomeTemplate
{
public:
  SomeTemplate()
  : something_( T1() )
  {}

  template <class T2>
  void operator()(T2 a, T2 b)
  {
    T2 c = something_ + a + b;
    std::cout << c << std::endl;
  }

  T1 something_;
};

template <class T3>
class ParentTemplate
{
public:
  ParentTemplate()
  {}

  void do_something()
  {
    T3 thing;
    thing.template operator()<int>(1, 2);
  }
};

int main(int, char*[])
{
  ParentTemplate< SomeTemplate<int> > parent_thing;
  parent_thing.do_something();
}


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]