{ Edits: "Subject" header corrected, was "subject", and banner area contents
corrected. Please note that articles with malformed headers cause problems and
will not necessarily be propagated by Usenet servers. Using a different Usenet
client, or simply using a Usenet client, might cure the problem. -mod }
Hi,
1.
I have a syntax question (I am not trying to write container independent
code). I would like to specify a container and its type, as for
example,
"something
However, I can't get the syntax right, as apparently the default
arguments,
i.e., allocator in the code below, is ignored.
It seems that U
one
of them should be automatically deduced. Nevertheless it doesn't
compile.
------------------------------------------------------------------------
-
#include
#include
template
> class U>
class wrapper
{
U
public:
size_t size() { return holder.size(); }
};
int main()
{
wrapper
intVec.size();
wrapper
intVec.size();
return 0;
}
------------------------------------------------------------------------
-
2.
Or even take this simple example:
How can one avoid specifying arguments in declaration of variable v_ ?
template
template class U = X1> class X2 { };
int main(int, char**)
{
X2<> v_; // use default parameters
}
--
[ See http://www.gotw.ca/resources/clcm.htm for info about ]
[ comp.lang.c++.moderated. First time posters: Do this! ]
RE: template args