By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
446,305 Members | 1,657 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 446,305 IT Pros & Developers. It's quick & easy.

grouping templates

P: n/a
Hi, I have a class using templates, and I'd like to know if there is any way
to avoid to write explicitly template <typename T> for every instances. sthg
like

template <typename T>{

class A{
..
}

Foo1( T);
Foo2(T);

etc

}

Thanks guys,

PSL
Jul 22 '05 #1
Share this Question
Share on Google+
1 Reply


P: n/a
Pascal Baup wrote:
Hi, I have a class using templates, and I'd like to know if there is any way
to avoid to write explicitly template <typename T> for every instances. sthg
like

template <typename T>{

class A{
..
}

Foo1( T);
Foo2(T);

etc

}


Sure:

template<typename T> struct grouper{
class A{
};
static void Foo1(T);
static void Foo2(T);
};
Jul 22 '05 #2

This discussion thread is closed

Replies have been disabled for this discussion.