|
// 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<typename list_in> struct sort_ascending;
template<
typename parent, // may be list_item<...> or list_tail<...>
typename parent::value_type value_first,
typename parent::value_type value_last
> struct sort_ascending<
list_item<parent, value_first, value_last>
> {
private:
typedef typename sort_ascending<parent>::type sorted_parent;
static const int p = find_insert_pos<
sorted_parent,
value_first,
value_last
>::value;
public:
typedef typename list_insert_at<
sorted_parent,
p,
value_first,
value_last
>::type type;
};
template<
typename value_type
> struct sort_ascending<
list_tail<value_type>
> {
typedef list_tail<value_type> 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.