Click here to Skip to main content
15,921,531 members
Home / Discussions / ATL / WTL / STL
   

ATL / WTL / STL

 
GeneralRe: BHO: Getting the title of the page loaded Pin
alanwolfen26-Apr-05 14:13
alanwolfen26-Apr-05 14:13 
GeneralUse science for programs Pin
Member 191102425-Apr-05 9:45
Member 191102425-Apr-05 9:45 
GeneralRe: Use science for programs Pin
abecedarian25-Apr-05 10:35
abecedarian25-Apr-05 10:35 
GeneralRe: Use science for programs Pin
ThatsAlok28-Apr-05 2:37
ThatsAlok28-Apr-05 2:37 
GeneralRe: Use science for programs Pin
toxcct18-May-05 3:13
toxcct18-May-05 3:13 
GeneralRe: Use science for programs Pin
toxcct18-May-05 3:11
toxcct18-May-05 3:11 
GeneralTemplates with Variable argument List Pin
sijis22-Apr-05 20:09
sijis22-Apr-05 20:09 
GeneralRe: Templates with Variable argument List Pin
Joaquín M López Muñoz23-Apr-05 9:08
Joaquín M López Muñoz23-Apr-05 9:08 
The short answer is no. The long answer is no, but you can fake this feature. For instance, the following creates the illusion of a class template allowing for an arbitrary number of type parameters up to 10:
struct void_arg{};
template <
  typename T0=void_arg,
  typename T1=void_arg,
  typename T2=void_arg,
  typename T3=void_arg,
  typename T4=void_arg,
  typename T5=void_arg,
  typename T6=void_arg,
  typename T7=void_arg,
  typename T8=void_arg,
  typename T9=void_arg
>
class my_template
{
  ...
};
 
...
 
//user code

typedef my_template<int,char,double> foo;
Note that void_arg is used as a marker meaning "no parameter specified". Now, the real problem is how to handle the variable number of parameters to do something useful: this will lead you to the realm of template metaprogramming (google for that.) Two libraries in Boost[^] named Boost.TypeTraits[^] and Boost MPL[^] are commonly used for doing template metaprogamming (beware, this is non-trivial stuff.)

If you have a specific problem where you want to take advantage of a variable number of template parameters, please post what you've got here and I can try to help a little.

Joaquín M López Muñoz
Telefónica, Investigación y Desarrollo
Want a Boost forum in Code Project? Vote here[^]!
GeneralRe: Templates with Variable argument List Pin
Nemanja Trifunovic23-Apr-05 16:03
Nemanja Trifunovic23-Apr-05 16:03 
GeneralWindow not being Painted Pin
TFrancis21-Apr-05 3:13
TFrancis21-Apr-05 3:13 
GeneralRe: Window not being Painted Pin
Michael Dunn24-Apr-05 21:27
sitebuilderMichael Dunn24-Apr-05 21:27 
GeneralRe: Window not being Painted Pin
TFrancis25-Apr-05 2:40
TFrancis25-Apr-05 2:40 
GeneralPlease Help~ Pin
Jack.Fu20-Apr-05 23:23
Jack.Fu20-Apr-05 23:23 
GeneralRe: Please Help~ Pin
James R. Twine21-Apr-05 2:37
James R. Twine21-Apr-05 2:37 
Generalatlsoap.h conflict with afxmt.h Pin
Yu_Matrix19-Apr-05 17:49
Yu_Matrix19-Apr-05 17:49 
GeneralRe: atlsoap.h conflict with afxmt.h Pin
CP Visitor19-Apr-05 23:18
CP Visitor19-Apr-05 23:18 
GeneralRe: atlsoap.h conflict with afxmt.h Pin
Yu_Matrix20-Apr-05 18:09
Yu_Matrix20-Apr-05 18:09 
GeneralRe: atlsoap.h conflict with afxmt.h Pin
CP Visitor20-Apr-05 23:36
CP Visitor20-Apr-05 23:36 
GeneralRe: atlsoap.h conflict with afxmt.h Pin
Yu_Matrix21-Apr-05 0:08
Yu_Matrix21-Apr-05 0:08 
GeneralWTL Wizard problems Pin
Tommy2d19-Apr-05 3:20
Tommy2d19-Apr-05 3:20 
GeneralRe: WTL Wizard problems Pin
Michael Dunn19-Apr-05 9:06
sitebuilderMichael Dunn19-Apr-05 9:06 
GeneralRe: WTL Wizard problems Pin
Tommy2d20-Apr-05 12:00
Tommy2d20-Apr-05 12:00 
GeneralProblem with hyperlink in atl Pin
Anonymous19-Apr-05 2:56
Anonymous19-Apr-05 2:56 
GeneralCould Not Able to find &quot;ylmtd.lib&quot; Pin
DirectCustomer18-Apr-05 22:56
DirectCustomer18-Apr-05 22:56 
GeneralClick events Pin
rjnl18-Apr-05 15:57
rjnl18-Apr-05 15:57 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.