Shamrock 2025.10.0
Astrophysical Code
Loading...
Searching...
No Matches
shamalgs::HasCustomDefaults Concept Reference

Detects whether Alt opts into exposing more than one default instance of itself (e.g. the same alternative with different tunable field values) via a static variant_custom_defaults() method, for example: More...

#include <shamalgs/include/shamalgs/ImplVariant.hpp>

Concept definition

template<class Alt>
concept shamalgs::HasCustomDefaults = requires {
{ Alt::variant_custom_defaults() } -> std::convertible_to<std::vector<Alt>>;
}
Detects whether Alt opts into exposing more than one default instance of itself (e....

Detailed Description

Detects whether Alt opts into exposing more than one default instance of itself (e.g. the same alternative with different tunable field values) via a static variant_custom_defaults() method, for example:

struct GpuTeamFetching {
static constexpr std::string_view variant_type_name = "gpu_team_fetching";
u32 group_size = 128;
static std::vector<GpuTeamFetching> variant_custom_defaults() {
return {GpuTeamFetching{128}, GpuTeamFetching{256}};
}
};
std::uint32_t u32
32 bit unsigned integer

Alternatives that do not define it (the common case) keep exposing exactly one, default-constructed instance.

Definition at line 111 of file ImplVariant.hpp.