Sender: huxw (Mi Duck and Tang Mouse), the letter area: Programming Title: Boost :: Iterator_adaptor (ii) Send Station: BBS Shuimu Tsinghua Station (Sun May 19 22:27:09 2002)
Affirmation: Here is just a skill. It seems too much from some kind of vision. So I just introduced the introduction, not to encourage everyone to get to torture your compiler. ;)
II) Simplify complex template parameters list
Many templates, Value, Pointer, Reference, etc. in the ITerator template are not connected between them. In fact, the default values of these template parameters are currently calculated.
template
It is reasonable, but have you ever thought if we don't need to provide so many mode-in-case parameters, what will I do? Have you ever thought that if such a result of pushing the result? So last The code we see is sauce purple.
template
What benefits can such a code? It is our sauce purple instantiation mode.
Iterator_adaptor Notice, the template parameters will not be the same as we declare.;) More wonderful, we can't do this when we use the function default parameters. Disclaimer: int Foo (int I, long j = 0, double k = 9.8); when called: foo (1, k = 8.7); // Error However, the template can be instantiated. The reason is that the hand and feet of Iterator_Adaptor started. He used an Iterator_Traits_Gen template. This template does not care about the mean of the template parameters. He is just simply build a Typelist, then use Find_Param typelist from the picking out the desired type .typedef detail :: cons_type typedef typename find_param In combination with the value_type_is similar method appearing in the above code, you must have a problem with Make_ARG. Indeed, Template Template template struct make_named_arg {template Is it a little experience? So long space, it's not easy to see it. Since I see it here, I will help a busy, write a letter to PEACH, please write Boost :: function. ;) - AbcdefghijklmnopqrStuvwxyzabcdefghijklmnopqrStuvwxyz ※ Modification: · Huxw at May 19 22:28:23 Modified this article · [From: 166.111.172.6] ※ Source: · BBS Shuimu Tsinghua Station bbs.edu.cn · [from: 166.111.172.6]