Skip to content

Detect C++03-style metafunctions #1160

@akrzemi1

Description

@akrzemi1

A common pattern in C++03 is to declare meta-functions (type traits) via classes and specializations derived from true_type or integral_constant<bool, ...>. Like:

template <typename MVP, typename = void>
struct check_safe_dual_storage_exception_safety : ::std::true_type {};

template <typename MVP>
struct check_safe_dual_storage_exception_safety<MVP, typename MVP::is_safe_dual_storage_mark_policy>
: std::integral_constant<bool, AK_TOOLKIT_IS_NOEXCEPT(typename MVP::representation_type(MVP::marked_value()))>
{
};

(https://github.com/akrzemi1/markable/blob/master/include/ak_toolkit/markable.hpp#L236-243)

It would be very useful if MrDocs were able to identify this as an idiom (even with the help of some marking) and express it more directly in the rendered docs.

Is this even possible?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions