Re: [sigc] libsigc++ & Forte: template operator()
- From: Murray Cumming <murrayc murrayc com>
- To: martin-ml hippogriff de
- Cc: libsigc++ list <libsigc-list gnome org>
- Subject: Re: [sigc] libsigc++ & Forte: template operator()
- Date: Sat, 20 Mar 2004 00:25:22 +0100
On Fri, 2004-03-19 at 18:39, martin-ml hippogriff de wrote:
> I think it can be stripped down. The following should do:
>
> class Thing
> {
> public:
> Thing()
> {}
>
> template <class T>
> void operator()(T a, T b)
> {
> T c = a + b;
> std::cout << c << std::endl;
> }
> };
>
> int main(int, char*[])
> {
> Thing thing_;
> thing_.template operator()<int>(1, 2);
> }
Thanks. That does succeed with g++ but not with my SUN Forte C++ 5.3 or
5.4. So I have made that a configure-time test. I suggest a quick
tarball release so that Damien can try it on his SUN Forte C+ 5.5.
My SUN Forte C++ 5.3 and 5.4 still get stuck on
CC -DHAVE_CONFIG_H -I.. -I.. -g -c signal.cc -KPIC -DPIC -o
.libs/signal.o
"../sigc++/functors/functor_trait.h", line 48: Error: Function templates
may not have default template parameters.
"../sigc++/functors/functor_trait.h", line 48: Error: Templates can only
declare classes or functions.
"../sigc++/functors/functor_trait.h", line 51: Error: Use ";" to
terminate state ments.
--
Murray Cumming
www.murrayc.com
murrayc murrayc com
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]