Ioannis Vranos wrote:
This compiles in all my compilers. What has it do with how many
arguments vector takes?
I looked at the OP and I was wondering the same thing.
vector is defined as: template <class T, class Allocator = allocator>
So, in your function template (to accept vector) you'd have to have
something like:
//---
#include <memory> // for allocator
#include <vector>
template< template<class, class> class CT, class VT, class AT>
inline void test(const VT &val)
{
CT<VT, AT> container(val);
}
int main()
{
using namespace std;
typedef allocator<int> intalloc;
test<vector, int, intalloc>(10);
}
//---
weird stuff (that you can't ignore auto-template parameters)...
--
Peter MacMillan
e-mail/msn:
pe***@writeopen.com
icq: 1-874-927
GCS/IT/L d-(-)>-pu s():(-) a- C+++(++++)>$ UL>$ P++ L+ E-(-) W++(+++)>$
N o w++>$ O !M- V PS PE Y+ t++ 5 X R* tv- b++(+) DI D+(++)>$ G e++ h r--
y(--)