|
It does not seem that the current version of clang-format recognizes requires clause very well.
An example:
If I write this…
template <typename T>
|
requires isRequestableOnTimeseries<T>
|
std::pair<bool, NamespaceString> isTimeseries(...)
|
the clang-format does its thing and changes the formatting like…
template <typename T>
|
requires isRequestableOnTimeseries<T> std::pair<bool, NamespaceString> isTimeseries(...)
|
Found that RequiresClausePosition option is supported since clang-format 15.0
https://clang.llvm.org/docs/ClangFormatStyleOptions.html#requiresclauseposition
One of its possible values is OwnLine which seems to be appropriate for us.
The concept is one of recommended features of C++20, it would be great to have the proper formatting support.
|