-
Notifications
You must be signed in to change notification settings - Fork 0
Open
Description
Right now the only (popular) feature of midl that requires non-trivial annotation is attribute. Commonly used attribute include:
- Windows repo's contract
- Xaml content
- bindable
Is it possible to declare these in C++ as well without needing to write [[idlgen::attribute("bindable",)]]? Note that C++ attribute is not extensible.
Idea
struct based
namespace idlgen
{
template <char const* Property = nullptr>
struct attribute
{
};
}
namespace wux
{
struct bindable_attribute : idlgen::attribute<>
{
};
template<char const* Property>
struct content_property_attribute : idlgen::attribute<Property>
{
};
}
const char property_name[] = "Property";
struct ViewModel : ViewModelT<ViewModel>, bindable_attribute, content_property_attribute<property_name>
{
}
SO says it's possible to use const char* as template parameter. Since we need to support C++17 C++20's std::string-in-template-parameter is not something idlgen can enjoy yet.
Metadata
Metadata
Assignees
Labels
No labels