Skip to content

Commit

Permalink
Create fix
Browse files Browse the repository at this point in the history
  • Loading branch information
xiran56 authored Dec 31, 2023
1 parent 8b77075 commit 20ab74d
Showing 1 changed file with 22 additions and 0 deletions.
22 changes: 22 additions & 0 deletions include/impl/fix
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
namespace util {
template<std::size_t N>
using c_str = char const [N];

template<auto const & str, std::size_t iter = std::size(str), char const ... chars>
struct c_str_to_arg_pack {
using arg_pack_t =
typename c_str_to_arg_pack<str, iter-1, str[iter-1], chars ... >
::arg_pack_t;
};

template<auto const & str, char const ... chars>
struct c_str_to_arg_pack<str, 0, chars ...> {
using arg_pack_t = c_str_to_arg_pack<str, 0, chars...>;

template <template <char ...> typename T>
using apply = T<chars ...>;
};
template<auto const & str, char const ... chars>
using c_str_to_arg_pack_t = typename c_str_to_arg_pack<str, chars ... >::arg_pack_t;

}

0 comments on commit 20ab74d

Please sign in to comment.