Severin Pappadeux
Severin Pappadeux

Reputation: 20080

What is good way to achieve formatting via clang-format?

All

Formatting C++ code, reasonable happy with what clang-format produced, except two things:

How could I make colon to be on the same line as constructor? INstead of

Detector::Detector()
     : _LogicTarget{nullptr},

I would like to get

Detector::Detector():
    _LogicTarget{nullptr},

Second question, could I remove break after access modifier?

public:
    void f();

should be

public: void f();

Upvotes: 2

Views: 642

Answers (1)

Kalana
Kalana

Reputation: 6143

You can do it by setting

AllowAllConstructorInitializersOnNextLine : true

Then output will be

Detector::Detector():
    _LogicTarget{nullptr}

and

public: void f();

Upvotes: 2

Related Questions