Skip to content
This repository has been archived by the owner on Mar 21, 2023. It is now read-only.

Commit

Permalink
Fixed a bug shown in cartesian_product
Browse files Browse the repository at this point in the history
  • Loading branch information
erythronelumbo committed Apr 25, 2021
1 parent f6ba24c commit a3c969c
Showing 1 changed file with 84 additions and 0 deletions.
84 changes: 84 additions & 0 deletions include/cynodelic/mulinum/concat.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,21 @@ template <typename...>
struct concat_impl {};


/**
* @brief Helper for `concat`.
*/
template <
typename IntType,
IntType... Items
>
struct concat_impl<
vector_c<IntType, Items...>
>
{
using type = vector_c<IntType, Items...>;
};


/**
* @brief Helper for `concat`.
*/
Expand Down Expand Up @@ -89,6 +104,18 @@ struct concat_impl<
};


/**
* @brief Helper for `concat`.
*/
template <char... Items>
struct concat_impl<
string<Items...>
>
{
using type = string<Items...>;
};


/**
* @brief Helper for `concat`.
*/
Expand All @@ -106,6 +133,20 @@ struct concat_impl<
};


/**
* @brief Helper for `concat`.
*/
template <
typename... Items
>
struct concat_impl<
vector<Items...>
>
{
using type = vector<Items...>;
};


/**
* @brief Helper for `concat`.
*/
Expand Down Expand Up @@ -146,6 +187,33 @@ struct concat_impl<
};


/**
* @brief Helper for `concat`.
*/
template <
typename Head,
typename Tail
>
struct concat_impl<
list_node<Head, Tail>
>
{
using type = list_node<Head, Tail>;
};


/**
* @brief Helper for `concat`.
*/
template <>
struct concat_impl<
null_type
>
{
using type = null_type;
};


/**
* @brief Helper for `concat`.
*/
Expand Down Expand Up @@ -241,6 +309,22 @@ struct concat_impl<
};


/**
* @brief Helper for `concat`.
*/
template <
typename IntType,
IntType Head,
typename Tail
>
struct concat_impl<
list_node_c<IntType, Head, Tail>
>
{
using type = list_node_c<IntType, Head, Tail>;
};


/**
* @brief Helper for `concat`.
*/
Expand Down

0 comments on commit a3c969c

Please sign in to comment.