Click here to Skip to main content
15,891,597 members
Articles / Programming Languages / VC++

Static Value Lists

Rate me:
Please Sign up or sign in to vote.
4.60/5 (7 votes)
25 Aug 2011CPOL18 min read 23.5K   246   17  
An introduction to advanced template metaprogramming using an explanatory project
#include "main.h"
#include "static_list.h"

using namespace lobster;
using namespace lobster::static_list;

typedef list_5<list_tail<int>, 1, 7, 3, 2, -42>::type my_int_list;

void int_demo() 
{
    stream_fo::write_box(std::cout, __FUNCTION__);
    
    COUT_INFO(to_string<my_int_list>().c_str());
    
    COUT_INFO(to_string<sort_ascending<my_int_list>::type>().c_str());
    
    COUT_INFO(to_string<compact<my_int_list>::type>().c_str());
    
    COUT_INFO(to_string<compact<sort_ascending<my_int_list>::type>::type>().c_str());
    
    std::cout << std::endl;
}

By viewing downloads associated with this article you agree to the Terms of Service and the article's licence.

If a file you wish to view isn't highlighted, and is a text file (not binary), please let us know and we'll add colourisation support for it.

License

This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)


Written By
Software Developer
Germany Germany
This member has not yet provided a Biography. Assume it's interesting and varied, and probably something to do with programming.

Comments and Discussions