|
// This file is part of the lobster library
// Copyright: Andreas Raczek
// This file is published under the The Code Project Open License (CPOL)
// See the file "CPOL.html" for the full license governing this code.
#pragma once
namespace lobster {
namespace static_list {
// Template declaration, necessary to inform gcc
// about variadic template
template<
typename tail,
typename tail::value_type... args
> struct var_list;
// Partial specialization for 2+ values
// variadic template parameter is split into head "v" and tail "args..."
template<
typename tail,
typename tail::value_type v,
typename tail::value_type... args
> struct var_list<
tail,
v,
args...
>
{
typedef typename var_list<list_item<tail, v>, args...>::type type;
// This typedef would build a reversed list:
// typedef typename list_item<var_list<tail, args...>, v>::type type;
};
// Partial specialization for last value (args... is empty)
template<
typename tail,
typename tail::value_type v>
struct var_list<
tail,
v
> {
typedef list_item<tail, v> type;
};
}
}
|
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.
This member has not yet provided a Biography. Assume it's interesting and varied, and probably something to do with programming.