List_av_N of function object

Source: Internet
Author: User

We have gone far and far, and now we are going back to our target list_av_N template:

[Cpp]
Template <class A1> struct list_av_1
{
Typedef typename add_value <A1 >:: type B1;
Typedef list1 <B1> type;
};
 
Template <class A1, class A2> struct list_av_2
{
Typedef typename add_value <A1 >:: type B1;
Typedef typename add_value <A2 >:: type B2;
Typedef list2 <B1, B2> type;
};
Therefore, when A1 is boost: arg <1>, B1 is boost: arg <1>.

List1 <B1> is a type. It inherits storage1 <B1> to obtain the ability to own the static member functions of A_1.

 

List_av_2 has B2 (boost: arg <2>) and a2 _ () static member functions more than list_av_1.

These capabilities are obtained during the compilation phase. This implementation method is easier to understand than Moder C ++ Design. The disadvantage is that the Code is much written.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.