-
Notifications
You must be signed in to change notification settings - Fork 43
Type dependent checks: Checks at all components #1120
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
base: feature/main-model-refactor-clean-templates-experiment
Are you sure you want to change the base?
Type dependent checks: Checks at all components #1120
Conversation
Signed-off-by: Nitish Bharambe <[email protected]>
@@ -27,9 +27,56 @@ | |||
#include "component/voltage_sensor.hpp" | |||
|
|||
namespace power_grid_model { | |||
namespace detail { | |||
template <typename List, typename T, typename... NeedsTypes> | |||
concept dependent_type_check = !IsInList<T, List>::value || (IsInList<NeedsTypes, List>::value && ...); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I was checking a different condition previously. It now seems to be possible to move these checks to MainModelType. Ill do so now.
… into feature/dependent-component-types-check
Signed-off-by: Nitish Bharambe <[email protected]>
This reverts commit d8a7bfa. Signed-off-by: Nitish Bharambe <[email protected]>
… into feature/dependent-component-types-check Signed-off-by: Nitish Bharambe <[email protected]>
… into feature/dependent-component-types-check Signed-off-by: Nitish Bharambe <[email protected]>
|
||
template <typename CompList> | ||
concept validate_component_types_c = | ||
dependent_type_check<CompList, Source, Node> && // |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
// in the end to avoid formatting
power_grid_model_c/power_grid_model/include/power_grid_model/main_core/main_model_type.hpp
Outdated
Show resolved
Hide resolved
…ain_core/main_model_type.hpp Signed-off-by: Nitish Bharambe <[email protected]>
From the discussions around #1109 , we bumped into the question about dependent types. Hence a separate PR for discussing/solving this issue.
I had initially thought of having this constraint on MainModelType. But what if we included this check at all_components.hpp only? (Edit: Moving back to MainModelType)