-
Notifications
You must be signed in to change notification settings - Fork 82
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Make mode()
a runtime decision
#1436
Comments
I think I figured out a way we can have nice hybrid options. Have a look at this: enum class select
{
all,
all_best,
best
};
template <select s>
struct static_conf
{
static constexpr select value = s;
};
struct dynamic_conf
{
select value;
};
constexpr dynamic_conf mode(select s)
{
return dynamic_conf{s};
}
template <select s>
constexpr static_conf<s> mode()
{
return {};
}
int main()
{
auto dyna = mode(select::all);
auto stati = mode<select::all>;
}
|
BTW: for the problem at hand an enum cannot be used, because struct search_mode
{
static constexpr int32_t all = -1;
static constexpr int32_t all_best = -2;
static constexpr int32_t best = -3;
using strata = int32_t;
};
auto m = search_mode::all;
auto m2 = search_mode::strata{2};
|
Will be implemented as part of #65 |
(user feedback)
Make it a hybrid configuration, i.e. it can be either set at runtime or at compile time if known already.
See https://github.com/seqan/seqan3/blob/master/include/seqan3/alignment/configuration/align_config_aligned_ends.hpp as a reference to implement both using almost the same interface.
Make the configuration options enums and then in addition define integral_constant values from the enums. Then the config can be called from the enum and the enum can be changed at runtime, or if the configuration is already known one can use the variable with the encoded enum.
The text was updated successfully, but these errors were encountered: