Mail Archives: djgpp/1997/03/27/09:44:35
I have recently downloaded the STL to use as a foundation for
my development. I have not yet used it with DJGPP but I have
seen other posts here that it works great.
I have one question concerning the syntax of templates. I have
attempted to compile on a Sun machine running SunOS 5.4 and
the SPARCompiler version 4.0.1 using C/C++ SC3.0.1 (that may
mean nothing to most of you and thats okay...)
For the following template syntax in the STL include file
"function.h":
.
.
.
template <class Result, class Argument = Result>
struct constant_unary_fun : public unary_function<Argument, Result> {
result_type val;
constant_unary_fun(const result_type& v) : val(v) {}
const result_type& operator()(const argument_type&) const { return
val; }
};
.
.
.
I get errors for the '=' as the compiler syas it is expecting a ','
or another class, etc. My question is: Is the = sign in templates
a new and widely unsupported feature of templates? If so, does djgpp
and gcc handle them correctly? Is there work arounds for this as I
am just learning the intracies of templates.
Thanks in advance!
-- David T. McKee:
-- Think: Innovative Science Learning Systems
-- Physics, Electrical Science, Computer
-- Science, Natural Science, Theology
======================Signature Block====================
It is the glory of God to conceal a matter; To search out
a matter is the glory of kings. Pr 25:2
---------------------------------------------------------
There is nothing so sacred as it cannot be looked into...
=========================================================
- Raw text -