Quantcast
Viewing all articles
Browse latest Browse all 60

How to make clang-format not add new line before opening brace of a function with requires clause?

When I auto-format with Clang-format, it is always inserting a newline before brace when requires clause is there.

This

constexpr auto size() const noexcept  requires(!Unique) {    return stdr::fold_left(views | stdv::transform(stdr::size), 0, std::plus<int>{});}

is becoming this

constexpr auto size() const noexcept  requires(!Unique){    return stdr::fold_left(views | stdv::transform(stdr::size), 0, std::plus<int>{});}

How to avoid it?

I have tried

RequiresClausePosition: WithPrecedingBraceWrapping:  AfterClass:      false  AfterControlStatement: false  AfterEnum:       false  AfterFunction:   false  AfterNamespace:  false  AfterObjCDeclaration: false  AfterStruct:     false  AfterUnion:      false  BeforeCatch:     false  BeforeElse:      false  IndentBraces:    falseBreakBeforeBraces: Custom

but these are not working.


Viewing all articles
Browse latest Browse all 60

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>