Skip to content

Improve formatting of concepts #64

Description

@bernhardmgruber

The current style config makes concept definitions quite verbose:

Here is a LLAMA concept using my private .clang-format:

    template <typename M>
    concept Mapping = requires(M m) {
        typename M::ArrayExtents;
        typename M::ArrayIndex;
        typename M::RecordDim;
        { m.extents() } -> std::same_as<typename M::ArrayExtents>;
        { +M::blobCount } -> std::same_as<std::size_t>;
        std::integral_constant<std::size_t, M::blobCount>{}; // validates constexpr-ness
        { m.blobSize(typename M::ArrayExtents::value_type{}) } -> std::same_as<typename M::ArrayExtents::value_type>;
    };

And now formatted with the CRP .clang-format:

    template<typename M>
    concept Mapping = requires(M m) {
                          typename M::ArrayExtents;
                          typename M::ArrayIndex;
                          typename M::RecordDim;
                          {
                              m.extents()
                              } -> std::same_as<typename M::ArrayExtents>;
                          {
                              +M::blobCount
                              } -> std::same_as<std::size_t>;
                          std::integral_constant<std::size_t, M::blobCount>{}; // validates constexpr-ness
                          {
                              m.blobSize(typename M::ArrayExtents::value_type{})
                              } -> std::same_as<typename M::ArrayExtents::value_type>;
                      };

Please consider improving the status-quo.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions