Skip to content
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

Fix for SST_ELI_DECLARE_NEW_BASE when BuilderInfo is a dependent name. #1006

Merged
merged 1 commit into from
Oct 14, 2023

Commits on Oct 12, 2023

  1. Fix for SST_ELI_DECLARE_NEW_BASE when BuilderInfo is a dependent …

    …name.
    
    This is easier to describe with an example first. Imagine the following code:
    
    ```c++
    template <class Component>
    struct MyComponentBase : public Component {
        SST_ELI_DECLARE_NEW_BASE(Component, MyComponentBase);
        // tools that help us with SST::Component interfaces
    };
    
    struct MyComponent : MyComponentBase<SST::Component> {
        // A custom component
    };
    
    struct MyRouter : MyComponentBase<SST::Merlin::Router> {
        // A merlin router implementation
    };
    ```
    
    In this context, inside the `SST_ELI_DECLARE_NEW_BASE`, the `BuilderInfo` is a
    dependent name in the `addDerivedInfo` template function, and can't be found
    without qualification. The qualified name is `__LocalEliBase::BuilderInfo` and
    it needs a `typename` pre-C++20.
    
    This patch adds that typename to support this template pattern. This pattern
    allows us to write utility code that can be injected into _any_ component
    hierarchy.
    ldalessa committed Oct 12, 2023
    Configuration menu
    Copy the full SHA
    5432cca View commit details
    Browse the repository at this point in the history