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



Am 2004.03.20 17:38 schrieb(en) Murray Cumming:
On Sat, 2004-03-20 at 14:30, Martin Schulze wrote:
> > 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.
>
> This is utter nonsense.

Well, it does look like an unusual technique.

We are using it in several places. It allows us to distinguish
between classes that do or don't inherit from functor_base / adaptor_base / lambda_base transparently. I'm not sure how to hack around this compiler bug and whether it's worth the effort. I suggest that we first decide what to do about the ".template operator()<...>()" problem.

Regards,

 Martin


>  Again it is pure guesswork to figure out
> what keeps the FORTE from compiling. I tried to create a test to
> reproduce the error (test_functor_trait1.cc) and a possible
> solution (test_functor_trait2.cc).

Sorry, both fail:

bash-2.03$ CC test_functor_base11.cc
Could not open input file "test_functor_base11.cc".
bash-2.03$ CC test_functor_base1.cc
"test_functor_base1.cc", line 88: Error: Function templates may not
have
default template parameters.
"test_functor_base1.cc", line 88: Error: Templates can only declare
classes or functions.
"test_functor_base1.cc", line 91: Error: Use ";" to terminate
statements.
"test_functor_base1.cc", line 92: Error: T_functor is not defined.
"test_functor_base1.cc", line 93: Error: A declaration was expected
instead of "}".
"test_functor_base1.cc", line 100: Error: No primary specialization
for
partial specialization functor_trait.
6 Error(s) detected.
bash-2.03$
bash-2.03$
bash-2.03$
bash-2.03$ CC test_functor_base2.cc
"test_functor_base2.cc", line 88: Error: Function templates may not
have
default template parameters.
"test_functor_base2.cc", line 88: Error: Templates can only declare
classes or functions.
"test_functor_base2.cc", line 96: Error: No primary specialization for
partial specialization functor_trait.
"test_functor_base2.cc", line 98: Error: Too many arguments for
template
functor_trait.
4 Error(s) detected.
bash-2.03$


>  If this fails, maybe
> is_base_and_derived<> is still causing troubles. To check this,
> I have attached test_base_and_derived.cc. Hopefully the tests
> lead to some result.

That builds without problems.

--
Murray Cumming
www.murrayc.com
murrayc murrayc com




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