c++ - storing a type's type for processing variable argument lists -


Is it possible to do something with:

  type t = int; // It will be a function that recognizes how the next argument is (t == int) printf ("% d", va_arg (theva_list, t));  

In a relatively trivial way? The only object that I know how can be of a type is type_info and how I can use it like this.

Thanks, Patrick

Generally speaking, no. In compiled time, types can only be actually stored, manipulated. If you want something at run time, then you have to convert it to some type of value (for example, a calculation) (usually through hair-metogramming).

Perhaps it would be better if you are somewhat of a high level of detail which you are actually trying to accomplish - combines the variable logic list with an attempt on "switch on type" This happens when a train accident occurs ...


Comments

Popular posts from this blog

oracle - The fastest way to check if some records in a database table? -

php - multilevel menu with multilevel array -

jQuery UI: Datepicker month format -