Exercices 3-3 and 3-4 (C++ Templates Metaprogramming)
I'm not sure of the meaning of "twice twice" and "twice on itself" respectively. My guess would be for exercice 3 that I should do something like : typedef twice<to_be_filled_1>::type T1; // T1 would be T ** // The second time, I replace T (in to_be_fiiled_1) by // T1 (in to_be_filled_2) , thus T2 is T1** which is also T**** typedef twice<to_be_filled_2>::type T2; while for exercice 4, we want something that would look like : typdef twice<twice<to_be_filled_3a>to_be_filled_3b>::type T3; Does I understand the questions correctly? For twice, I use the definition from section 3.3.2. Philippe
Philippe Mori writes:
I'm not sure of the meaning of "twice twice" and "twice on itself" respectively.
My guess would be for exercice 3 that I should do something like :
typedef twice<to_be_filled_1>::type T1; // T1 would be T **
// The second time, I replace T (in to_be_fiiled_1) by // T1 (in to_be_filled_2) , thus T2 is T1** which is also T**** typedef twice<to_be_filled_2>::type T2;
while for exercice 4, we want something that would look like :
typdef twice<twice<to_be_filled_3a>to_be_filled_3b>::type T3;
Does I understand the questions correctly?
Yep. -- Aleksey Gurtovoy MetaCommunications Engineering
participants (2)
-
Aleksey Gurtovoy
-
Philippe Mori